2.3 KiB
2.3 KiB
Create Tag
Purpose of the Create Tag API
Use this API to create a tag.
Endpoint
Authentication: required
POST /tag/create.json
Parameters
- tag (required), The name of the tag to create
- count (optional), Number of photos which contain this tag
- email (optional), An email address that corresponds to this tag
- latitude (optional), i.e. 34.76 - A decimal representation of latitude.
- 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
}
}