PeopleAggregator API: method peopleaggregator.getContent

Arguments | Return value | REST (XML) example | REST (JSON) example | XML-RPC example

Method: peopleaggregator.getContent

Retrieve content (blog posts, event info, media, reviews, showcases, listings) from the community ("global") blog, a particular user, a group, a tag, or a search query.

Arguments (see also Authentication)

If calling by XML-RPC, note that this method takes a single struct as input, with the following keys:

context

Type: string
The context from which to retrieve content: specify 'global' to retrieve content from the community blog, 'user:123' to retrieve content from user #123's blog, 'group:42' to retrieve content from group #42's blog, 'tag:2' to retrieve content with tag #2, or 'search:search terms' to retrieve content matching a search query.
Example: user:26

detailLevel

Type: enum
How much detail you want to retrieve: 'all' to get post metadata, content and SB XML, 'content' to get metadata and content, or 'summary' just to get metadata.
Allowed values: all, content, summary
Example: all
Default: all

page

Type: int
Page number to retrieve.
Example: 2
Minimum: 1
Default: 1

resultsPerPage

Type: int
How many content items you wish to retrieve per page.
Example: 42
Minimum: 10
Maximum: 100
Default: 10

Return value (see also Exceptions)

Type: hash

Attributes:

success

Type: boolean
true on success, false on failure.
Example: True

msg

Type: string
Message indicating success or failure detail.
Example: Retrieved 42 blog entries

detailLevel

Type: enum
How much detail was shown (see detailLevel argument for detail).
Allowed values: all, content, summary
Example: all
Default: all

page

Type: int
Page number of retrieved info.
Example: 2

resultsPerPage

Type: int
Number of content items per results page.
Example: 42

totalPages

Type: int
The total number of pages available.
Example: 96

totalResults

Type: int
The total number of content items available.
Example: 4000

items

Type: array

Content of each item:

item

Type: hash

Attributes:

id

Type: string
ID of the retrieved content item.
Example: content:123

url

Type: string
Permalink of the retrieved content item.
Example: http://peopleaggregator.org/content.php?cid=140

title

Type: string
Title of the content item.
Example: PeopleAggregator lives!

content

Type: string
Content of the content.
Example: Testing, testing - this is the first post.
Default:

Example REST (XML) request

Request

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 827

<response>
 <totalPages>96</totalPages>
 <success>true</success>
 <items>
  <item>
   <url>http://peopleaggregator.org/content.php?cid=140</url>
   <content>Testing, testing - this is the first post.</content>
   <id>content:123</id>
   <title>PeopleAggregator lives!</title>
  </item>
 </items>
 <detailLevel>all</detailLevel>
 <resultsPerPage>42</resultsPerPage>
 <msg>Retrieved 42 blog entries</msg>
 <totalResults>4000</totalResults>
 <page>2</page>
</response>

Example REST (JSON) request

Request

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Content-Length: 333

{"totalPages": 96, "success": true, "items": [{"url": "http://peopleaggregator.org/content.php?cid=140", "content": "Testing, testing - this is the first post.", "id": "content:123", "title": "PeopleAggregator lives!"}], "detailLevel": "all", "resultsPerPage": 42, "msg": "Retrieved 42 blog entries", "totalResults": 4000, "page": 2}

Example XML-RPC call

Request

POST /api/xmlrpc HTTP/1.1
Content-Type: text/xml
Content-Length: 1513

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.getContent</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>detailLevel</name>
      <value><string>all</string></value>
     </member>
     <member>
      <name>resultsPerPage</name>
      <value><int>42</int></value>
     </member>
     <member>
      <name>page</name>
      <value><int>2</int></value>
     </member>
     <member>
      <name>context</name>
      <value><string>user:26</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 4223

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>totalPages</name>
      <value><int>96</int></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
     <member>
      <name>items</name>
      <value><array><data>
       <value><struct>
        <member>
         <name>url</name>
         <value><string>http://peopleaggregator.org/content.php?cid=140</string></value>
        </member>
        <member>
         <name>content</name>
         <value><string>Testing, testing - this is the first post.</string></value>
        </member>
        <member>
         <name>id</name>
         <value><string>content:123</string></value>
        </member>
        <member>
         <name>title</name>
         <value><string>PeopleAggregator lives!</string></value>
        </member>
       </struct></value>
      </data></array></value>
     </member>
     <member>
      <name>detailLevel</name>
      <value><string>all</string></value>
     </member>
     <member>
      <name>resultsPerPage</name>
      <value><int>42</int></value>
     </member>
     <member>
      <name>msg</name>
      <value><string>Retrieved 42 blog entries</string></value>
     </member>
     <member>
      <name>totalResults</name>
      <value><int>4000</int></value>
     </member>
     <member>
      <name>page</name>
      <value><int>2</int></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>