-
Notifications
You must be signed in to change notification settings - Fork 0
api photo list
Jay Williams edited this page Mar 7, 2012
·
5 revisions
Retrieve photo list.
require read
grant access
GET http://example.com/api/get/photo.list/json/?fields[]=id&fields[]=title&fields[]=publish-date&fields[]=thumb-url&pager[page]=1&pager[max-per-page]=10&sort[publish-date]=desc&sort[title]=asc&filter[visible]=1&filter[publish-date-interval][start]=2011-05-01T00:00:00+00:00&filter[publish-date-interval][end]=2011-05-31T00:00:00+00:00
{
"method" : "photo.list",
"request" :
{
"fields" : [ "id", "title", "publish-date", "thumb-url" ],
"pager" :
{
"page" : 1,
"max-per-page" : 10
},
"sort" :
{
"publish-date" : "desc",
"title" : "asc"
},
"filter" :
{
"visible" : true,
"publish-date-interval" :
{
"start" : "2011-05-01T00:00:00+00:00",
"end" : "2011-05-31T23:59:59+00:00"
}
}
}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
<method>photo.list</method>
<request>
<fields>id</fields>
<fields>title</fields>
<fields>publish-date</fields>
<fields>thumb-url</fields>
<pager>
<page>1</page>
<max-per-page>10</max-per-page>
</pager>
<sort>
<publish-date>desc</publish-date>
<title>asc</title>
</sort>
<filter>
<visible>true</visible>
<publish-date-interval>
<start>2011-05-01T00:00:00+00:00</start>
<end>2011-05-31T23:59:59+00:00</end>
</publish-date-interval>
</filter>
</request>
</xml>
{
"status" : "valid",
"response" :
{
"photo" :
[
{
"id" : 12,
"title" : "A butterfly",
"publish-date": "2011-05-03T16:38:12+00:00",
"thumb-url" : "http://something.com/photos/thumb/kGj123.jpeg"
},
{
"id" : 23,
"title" : "Daddy Portrait",
"publish-date": "2011-05-12T09:12:54+00:00",
"thumb-url" : "http://something.com/photos/thumb/ACv3hI.jpeg"
}
]
}
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<xml>
<status>valid</status>
<response>
<photo>
<id>12</id>
<title>A butterfly</title>
<publish-date>2011-05-03T16:38:12+00:00</publish-date>
<thumb-url>http://something.com/photos/thumb/kGj123.jpeg</thumb-url>
</photo>
<photo>
<id>23</id>
<title>Daddy Portrait</title>
<publish-date>2011-05-12T09:12:54+00:00</publish-date>
<thumb-url>http://something.com/photos/thumb/ACv3hI.jpeg</thumb-url>
</photo>
</response>
</xml>
-
fields: an array of field:
id
|filename
|title
|description
|publish-date
|visible
|thumb-url
|resized-url
|original-url
. -
[pager]: use this filter to paginate your result or limit to X result by setting page to 1 and max-per-page to X
- page: number of the page
- max-per-page: max number of item per page
-
[sort]: order result
-
[id]:
asc
|desc
-
[filename]:
asc
|desc
-
[title]:
asc
|desc
-
[description]:
asc
|desc
-
[publish-date]:
asc
|desc
-
[visible]:
asc
|desc
-
[id]:
-
[filter]: filters the result set
- [visible]: a boolean value, visible or not visible photo
- [publish-date-interval]: *[start]: RFC 3339 datetime, the min photo publish date *[end]: RFC 3339 datetime, the max photo publish date
NOTE:
thumb-url
andresized-url
photo size can be known by using photo.size API method.original-url
photo size is always unknown.
NOTE:
publish-date
: follow RFC 3339
visible
: returned as boolean