photo-documentation/docs/api/PostTagCreate.markdown
2013-01-28 22:49:14 -05:00

2.3 KiB

Create Tag


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

Purpose of the Create Tag API

Use this API to create a tag.


Endpoint

Authentication: required

POST /tag/create.json

Parameters

  1. tag (required), The name of the tag to create
  2. count (optional), Number of photos which contain this tag
  3. email (optional), An email address that corresponds to this tag
  4. latitude (optional), i.e. 34.76 - A decimal representation of latitude.
  5. longitude (optional), i.e. -87.45 - A decimal representation of longitude.

Examples

Command Line (using openphoto-php)

./openphoto -p -X POST -h current.openphoto.me -e /tag/create.json -F 'tag=sunnyvale' -F 'count=10'

PHP (using openphoto-php)

$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->post("/tag/create.json", array('tag' => 'sunnyvale', 'count' => 10));

Response

The response is in a standard response envelope.

  • message, A string describing the result. Don't use this for anything but reading.
  • code, 201 on success
  • result, A Tag object or FALSE on error

Sample

{
  "message":"",
  "code":201,
  "result":     	
  {
    "id": "mountain",
    "count": 0
  }
}