Skip to content

Latest commit

 

History

History
118 lines (89 loc) · 2.61 KB

GetTags.markdown

File metadata and controls

118 lines (89 loc) · 2.61 KB

Get Tags


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

Purpose of the Get Tags API

Use this API to get a user's tags.


Endpoint

Authentication: optional

GET /tags/list.json

Parameters

None


Examples

Command Line (using openphoto-php)

./openphoto -p -h current.openphoto.me -e /tags/list.json

PHP (using openphoto-php)

$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->get("/tags/list.json");

Python (using openphoto-python)

client = openphoto.OpenPhoto()
print(client.tags.list())

    [<openphoto.objects.Tag id='australia'>, <openphoto.objects.Tag id='Boracay Philippines'>, ...]

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, An array of Tag objects

Sample

{
  "message":"",
  "code":200,
  "result":
  [
    {
      "id": "mountain",
      "count": 1
    },
    {
      "id": "jaisen",
      "count": 10,
      "email": "jaisen@jmathai.com"
    },
    {
      "id": "New York",
      "count": 9,
      "latitude": 12.3456,
      "longitude": 78.9012
    },
    {
      "id": "Sunnyvale",
      "count":23
      "latitude": 13.579,
      "longitude": 24.68
    },
    ....
  ]
}