Fotki Public API DocumentationYou will need a secret and a public key to use Fotki public API. For all API calls the following parameter is needed: api_key – API public key. Many methods require the user to be logged in. So here is an authorization procedure. AuthorizationFirst of all you must obtain API keys (public and secure). The authorization procedure consists of the following steps:
Request FormatsPOST/GET:It’s a simple HTTP GET or POST request. Example of REST request: http://api.fotki.com/v2flkr/upload?title=NewPhoto&description=NewPhotoDescription&tags=new,photo,api&photo=[photo_itself] Response FormatsDEFAULT Response Format:By default response is simple xml‐document Example: <?xml version="1.0" encoding="utf8" ?> <rsp stat="ok"> <photoid>487624164546</photoid> </rsp>if error occurs, so: <?xml version="1.0" encoding="utf8" ?> <rsp stat="fail"> <err code="12" msg="Cannot upload photo" /> </rsp>JSON response format: If you specify “format=json” in your request, Fotki will response in JSONformat. It is almost the same as DEFAULT Response Format, but transformed in JSON – read json.org to get more info about this format. Example: DEFAULT XML: <?xml version="1.0" encoding="utf8" ?> <rsp stat="ok"> <photoid>487624164546</photoid> </rsp>JSON for this DEFAULT XML:
{"photo" : {"_content":"487624164546"} , "stat":"ok"}
API FunctionsEvery API–call must be signed. So every API–call must contain api_sig parameter.Signing procedure:
http://api.fotki.com/v2flkr/flickr_photos_getInfo : Get information about a photo.This method does not require authorization.Parameters: api_key (Required) Your API public key. photo_id (Required) The id of the photo to get information for. Example Response
<photo id="4878654632" license="3" rotation="90" originalformat="png">
<owner nsid="46656165646" username="none" realname="Real None" location="San Francisco" />
<title>Title</title>
<description>It is Description</description>
<visibility ispublic="1" isfriend="0" isfamily="0" />
<dates posted="1711655130" taken="20090625 15:22:19" takengranularity="0" lastupdate="1815627043" />
<permissions permcomment="3" permaddmeta="2" />
<editability cancomment="1" canaddmeta="1" />
<comments>1</comments>
<tags>
<tag id="465456465" author="46656165646" raw="tag1">tag1</tag>
<tag id="465456464" author="46656165646" raw="tag2">tag2</tag>
</tags>
<urls>
<url type="photopage">http://www.fotki.com/none/testalbum/Title.png</url>
</urls>
</photo>
http://api.fotki.com/v2flkr/flickr_photos_getNotInSet : Returns a list of your photos that are not part of any sets.This method requires authorization.Parameters: api_key (Required) Your API public key. Example Response This method returns the standard photo list xml: <photos page="1" pages="3" perpage="10" total="25"> <photo id="466654687" owner="321546454456" title="title1" ispublic="1" isfriend="0" isfamily="0" /> <photo id="654548864" owner="321546454456" title="title2" ispublic="0" isfriend="1" isfamily="1" /> <photo id="465432132" owner="321546454456" title="title3" ispublic="1" isfriend="0" isfamily="0" /> <photo id="4565213888" owner="321546454456" title="title4" ispublic="1" isfriend="0" isfamily="0" /> </photos> http://api.fotki.com/v2flkr/flickr_photosets_addPhoto : Add a photo to the end of an existing photoset.This method requires authorization.Parameters: api_key (Required) Your API public key. photoset_id (Required) The id of the photoset photo_id (Required) The id of the photo. Example Response This method returns empty success or fail response http://api.fotki.com/v2flkr/flickr_photosets_create : Create a new photoset for the calling user.This method requires authorization.Parameters: api_key (Required) Your API public key. btitle (Required) A title for the photoset. description (Optional) A description of the photoset. primary_photo_id (Required) The id of the photo to represent this set. The photo must belong to the calling user. Example Response <photoset id="45654895" url="http://www.fotki.com/none/newphotoset/" /> http://api.fotki.com/v2flkr/flickr_photosets_delete : Delete a photosetThis method requires authorization.Parameters: api_key (Required) Your API public key. photoset_id (Required) The id of the photoset to delete Example Response This method returns empty success or fail response http://api.fotki.com/v2flkr/flickr_photosets_editMeta : Modify the meta‐data for a photoset.This method requires authorization.Parameters: api_key (Required) Your API public key. photoset_id (Required) The id of the photoset to delete title (Required) The new title for the photoset. description (Optional) A description of the photoset. May contain limited html. Example Response This method returns empty success or fail response http://api.fotki.com/v2flkr/flickr_photosets_getList : Returns the photosets belonging to the specified user.This method does not require authorization.Parameters: api_key (Required) Your API application key. user_id (Optional) The ID of the user to get a photoset list for. Example Response
<photosets cancreate="1">
<photoset id="456786521" primary="46876213" photos="2" farm="1">
<title>Test</title>
<description>Test description</description>
</photoset>
<photoset id="721364646" primary="4566687963" photos="12" farm="1">
<title>Next Set</title>
<description>This is description too</description>
</photoset>
</photosets>
http://api.fotki.com/v2flkr/flickr_photosets_getPhotos : Get the list of photos in a set.This method does not require authorization.Parameters: api_key (Required) Your API application key. See here for more details. photoset_id (Required) The id of the photoset to return the photos for Example Response <photoset id="456786521" primary="46876213" page="1" perpage="500" pages="1" total="2"> <photo id="45456488" title="photo in this set" isprimary="0" /> <photo id="46876213" title="fotki is cool" isprimary="1" /> </photoset> http://api.fotki.com/v2flkr/upload : Upload a photoThis method requires authorization.Parameters: api_key (Required) Your API application key. photo The file to upload. title (optional) The title of the photo. description (optional) A description of the photo tags (optional) A spaceseperated photo tags Example Response <photoid>468786232</photoid> [back] |