PeopleAggregator API: method peopleaggregator.getFiles

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

Method: peopleaggregator.getFiles

Retrieve all media files in a given album or group.

Arguments (see also Authentication)

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

authToken

Type: string
Authentication token for the user whose files you want to query
Example: as9d867f234o7asdf:928734982734987234:298374982734987234

context

Type: string
A group ID to retrieve media files from a group, or an album ID to retrieve media files from an album
Example: group:42

Return value (see also Exceptions)

Type: hash

Attributes:

success

Type: boolean
true if the file was successfully received and saved, or false if an error occurred.
Example: True

files

Type: array

Content of each item:

item

Type: hash

Attributes:

id

Type: string
File ID
Example: file:42

url

Type: string
URL of file (or blank if an error occurred reading the file - e.g. if the file has been deleted)
Example: http://peopleaggregator.org/files/something.jpg

title

Type: string
Title for file description
Example: Picture of something

content

Type: string
Long description of file
Example: I can't remember what this is, but it's definitely something.

created

Type: string
When the file was uploaded
Example: (FIXME: some sort of standard date value?)

type

Type: enum
File class
Allowed values: image, audio, video
Example: image

author

Type: string
ID of user who uploaded the file
Example: user:26

width

Type: int
Width of image (only for image files)
Example: 42

height

Type: int
Height of image (only for image files)
Example: 42

Example REST (XML) request

Request

Response

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

<response>
 <files>
  <item>
   <author>user:26</author>
   <created>(FIXME: some sort of standard date value?)</created>
   <url>http://peopleaggregator.org/files/something.jpg</url>
   <title>Picture of something</title>
   <height>42</height>
   <content>I can't remember what this is, but it's definitely something.</content>
   <width>42</width>
   <type>image</type>
   <id>file:42</id>
  </item>
 </files>
 <success>true</success>
</response>

Example REST (JSON) request

Request

Response

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

{"files": [{"author": "user:26", "created": "(FIXME: some sort of standard date value?)", "url": "http://peopleaggregator.org/files/something.jpg", "title": "Picture of something", "height": 42, "content": "I can't remember what this is, but it's definitely something.", "width": 42, "type": "image", "id": "file:42"}], "success": true}

Example XML-RPC call

Request

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

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.getFiles</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>authToken</name>
      <value><string>as9d867f234o7asdf:928734982734987234:298374982734987234</string></value>
     </member>
     <member>
      <name>context</name>
      <value><string>group:42</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

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

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>files</name>
      <value><array><data>
       <value><struct>
        <member>
         <name>author</name>
         <value><string>user:26</string></value>
        </member>
        <member>
         <name>created</name>
         <value><string>(FIXME: some sort of standard date value?)</string></value>
        </member>
        <member>
         <name>url</name>
         <value><string>http://peopleaggregator.org/files/something.jpg</string></value>
        </member>
        <member>
         <name>title</name>
         <value><string>Picture of something</string></value>
        </member>
        <member>
         <name>height</name>
         <value><int>42</int></value>
        </member>
        <member>
         <name>content</name>
         <value><string>I can't remember what this is, but it's definitely something.</string></value>
        </member>
        <member>
         <name>width</name>
         <value><int>42</int></value>
        </member>
        <member>
         <name>type</name>
         <value><string>image</string></value>
        </member>
        <member>
         <name>id</name>
         <value><string>file:42</string></value>
        </member>
       </struct></value>
      </data></array></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>