photo-front/documentation/api/GetPhoto.markdown

2.9 KiB

Open Photo API / Get Photo

OpenPhoto, a photo service for the masses


  1. Purpose
  2. Endpoint
  3. Parameters
  4. Examples
  1. Response

Purpose of the Get Photo API

Use this API to get a single of photo for a user.

NOTE: Always pass in the returnSizes parameter for sizes you plan on using. It's the only way to guarantee that a URL for that size will be present in the response. See Photo Generation for details.


Endpoint

Authentication: optional

GET /photo/:id/view.json

Parameters

  1. returnSizes (optional), The photo sizes you'd like in the response. Specify every size you plan on using. Docs for this parameter

Examples

Command line curl

curl http://jmathai.openphoto.me/photo/abc.json

PHP

$ch = curl_init('http://jmathai.openphoto.me/photo/abc.json');
curl_exec($ch);

Response

The response is in a standard response envelope.

  • message, A string describing the result. Don't use this for anything but reading.
  • code, 200 on success
  • result, A Photo object

Sample

{
  "message":"",
  "code":200,
  "result":{
    "tags":[
      ""
    ],
    "pathBase":"\/base\/201107\/1311045184-opme7Z0WBh.jpg",
    "appId":"opme",
    "host":"testjmathai1.s3.amazonaws.com",
    "dateUploadedMonth":"07",
    "status":"1",
    "hash":"fba49a238426ac3485af6d69967ccd2d08c1fe5c",
    "width":"569",
    "dateTakenMonth":"07",
    "dateTakenDay":"18",
    "permission":"0",
    "pathOriginal":"\/original\/201107\/1311045184-opme7Z0WBh.jpg",
    "exifCameraMake":"",
    "size":"0",
    "dateTaken":"1311045184",
    "height":"476",
    "views":"0",
    "dateUploadedYear":"2011",
    "dateTakenYear":"2011",
    "creativeCommons":"BY-NC",
    "dateUploadedDay":"18",
    "dateUploaded":"1311045188",
    "exifCameraModel":"",
    "path200x200":"\/custom\/201107\/1311045184-opme7Z0WBh_200x200.jpg",
    "id":"hl"
  }
}