* Remove email/latitude/longitude
* Add actor/owner (although I'm not sure exactly what these mean) * Add delete tag API * Mark create/delete API as "internal" * Create API returns TRUE, not the created tag * Removed update API examples
This commit is contained in:
parent
95866e086c
commit
7ac8e553c5
6 changed files with 113 additions and 27 deletions
|
@ -72,23 +72,26 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
|
||||||
{
|
{
|
||||||
"id": "mountain",
|
"id": "mountain",
|
||||||
"count": 1
|
"count": 1
|
||||||
|
"actor": "jaisen@jmathai.com"
|
||||||
|
"owner": "jaisen@jmathai.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "jaisen",
|
"id": "jaisen",
|
||||||
"count": 10,
|
"count": 10,
|
||||||
"email": "jaisen@jmathai.com"
|
"actor": "jaisen@jmathai.com"
|
||||||
|
"owner": "jaisen@jmathai.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "New York",
|
"id": "New York",
|
||||||
"count": 9,
|
"count": 9,
|
||||||
"latitude": 12.3456,
|
"actor": "jaisen@jmathai.com"
|
||||||
"longitude": 78.9012
|
"owner": "jaisen@jmathai.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Sunnyvale",
|
"id": "Sunnyvale",
|
||||||
"count":23
|
"count":23
|
||||||
"latitude": 13.579,
|
"actor": "jaisen@jmathai.com"
|
||||||
"longitude": 24.68
|
"owner": "jaisen@jmathai.com"
|
||||||
},
|
},
|
||||||
....
|
....
|
||||||
]
|
]
|
||||||
|
|
|
@ -18,7 +18,8 @@ Create Tag
|
||||||
<a name="purpose"></a>
|
<a name="purpose"></a>
|
||||||
### Purpose of the Create Tag API
|
### Purpose of the Create Tag API
|
||||||
|
|
||||||
Use this API to create a tag.
|
This API is used internally to create a tag.
|
||||||
|
External applications should use the [Photo Update API](http://theopenphotoproject.org/documentation/api/PostPhotoUpdate) to create tags.
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
@ -34,9 +35,6 @@ _Authentication: required_
|
||||||
|
|
||||||
1. tag (required), The name of the tag to create
|
1. tag (required), The name of the tag to create
|
||||||
1. count (optional), Number of photos which contain this tag
|
1. count (optional), Number of photos which contain this tag
|
||||||
1. email (optional), An email address that corresponds to this tag
|
|
||||||
1. latitude (optional), _i.e. 34.76_ - A decimal representation of latitude.
|
|
||||||
1. longitude (optional), _i.e. -87.45_ - A decimal representation of longitude.
|
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
@ -63,7 +61,7 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
|
||||||
|
|
||||||
* _message_, A string describing the result. Don't use this for anything but reading.
|
* _message_, A string describing the result. Don't use this for anything but reading.
|
||||||
* _code_, _201_ on success
|
* _code_, _201_ on success
|
||||||
* _result_, A [Tag][Tag] object or FALSE on error
|
* _result_, TRUE if the tag was successfully created
|
||||||
|
|
||||||
<a name="sample"></a>
|
<a name="sample"></a>
|
||||||
#### Sample
|
#### Sample
|
||||||
|
@ -71,11 +69,7 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
|
||||||
{
|
{
|
||||||
"message":"",
|
"message":"",
|
||||||
"code":201,
|
"code":201,
|
||||||
"result":
|
"result":TRUE
|
||||||
{
|
|
||||||
"id": "mountain",
|
|
||||||
"count": 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
83
docs/api/PostTagDelete.markdown
Normal file
83
docs/api/PostTagDelete.markdown
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
Delete Tag
|
||||||
|
=======================
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
1. [Purpose][purpose]
|
||||||
|
1. [Endpoint][endpoint]
|
||||||
|
1. [Parameters][parameters]
|
||||||
|
1. [Examples][examples]
|
||||||
|
* [Command line][example-cli]
|
||||||
|
* [PHP][example-php]
|
||||||
|
1. [Response][response]
|
||||||
|
* [Sample][sample]
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="purpose"></a>
|
||||||
|
### Purpose of the Delete Tag API
|
||||||
|
|
||||||
|
This API is used internally to delete a tag.
|
||||||
|
External applications should use the [Photo Update API](http://theopenphotoproject.org/documentation/api/PostPhotoUpdate) to delete tags.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="endpoint"></a>
|
||||||
|
### Endpoint
|
||||||
|
|
||||||
|
_Authentication: required_
|
||||||
|
|
||||||
|
POST /tag/:id/delete.json
|
||||||
|
|
||||||
|
<a name="parameters"></a>
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="examples"></a>
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
<a name="example-cli"></a>
|
||||||
|
#### Command Line (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
|
./openphoto -p -X POST -h current.trovebox.com -e /tag/sunnyvale/delete.json
|
||||||
|
|
||||||
|
<a name="example-php"></a>
|
||||||
|
#### PHP (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
|
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
||||||
|
$response = $client->post("/tag/sunnyvale/delete.json");
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="response"></a>
|
||||||
|
### Response
|
||||||
|
|
||||||
|
The response is in a standard [response envelope](http://theopenphotoproject.org/documentation/api/Envelope).
|
||||||
|
|
||||||
|
* _message_, A string describing the result. Don't use this for anything but reading.
|
||||||
|
* _code_, _201_ on success
|
||||||
|
* _result_, TRUE if the tag was successfully deleted
|
||||||
|
|
||||||
|
<a name="sample"></a>
|
||||||
|
#### Sample
|
||||||
|
|
||||||
|
{
|
||||||
|
"message":"",
|
||||||
|
"code":201,
|
||||||
|
"result":TRUE
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
|
||||||
|
[purpose]: #purpose
|
||||||
|
[endpoint]: #endpoint
|
||||||
|
[parameters]: #parameters
|
||||||
|
[examples]: #examples
|
||||||
|
[example-cli]: #example-cli
|
||||||
|
[example-php]: #example-php
|
||||||
|
[response]: #response
|
||||||
|
[sample]: #sample
|
||||||
|
[openphoto-php]: https://github.com/photo/openphoto-php
|
||||||
|
|
|
@ -7,11 +7,14 @@ Update Tag
|
||||||
1. [Purpose][purpose]
|
1. [Purpose][purpose]
|
||||||
1. [Endpoint][endpoint]
|
1. [Endpoint][endpoint]
|
||||||
1. [Parameters][parameters]
|
1. [Parameters][parameters]
|
||||||
|
<!--- NOTE: These examples are not valid, since there are no tag attributes that can be updated.
|
||||||
|
Leave this commented out until an updateable tag attribute is added.
|
||||||
1. [Examples][examples]
|
1. [Examples][examples]
|
||||||
* [Command line][example-cli]
|
* [Command line][example-cli]
|
||||||
* [PHP][example-php]
|
* [PHP][example-php]
|
||||||
1. [Response][response]
|
1. [Response][response]
|
||||||
* [Sample][sample]
|
* [Sample][sample]
|
||||||
|
--->
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
@ -32,22 +35,24 @@ _Authentication: required_
|
||||||
<a name="parameters"></a>
|
<a name="parameters"></a>
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
1. count (optional), Number of photos which contain this tag
|
There are not currently any tag attributes that can be updated.
|
||||||
1. email (optional), An email address that corresponds to this tag
|
|
||||||
1. latitude (optional), _i.e. 34.76_ - A decimal representation of latitude.
|
|
||||||
1. longitude (optional), _i.e. -87.45_ - A decimal representation of longitude.
|
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
<!--- NOTE: These examples are not valid, since there are no tag attributes that can be updated.
|
||||||
|
Leave this commented out until an updateable tag attribute is added.
|
||||||
|
|
||||||
<a name="examples"></a>
|
<a name="examples"></a>
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
<a name="example-cli"></a>
|
<a name="example-cli"></a>
|
||||||
|
|
||||||
#### Command Line (using [openphoto-php][openphoto-php])
|
#### Command Line (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
./openphoto -p -X POST -h current.openphoto.me -e /tag/sunnyvale/update.json -F 'count=10'
|
./openphoto -p -X POST -h current.openphoto.me -e /tag/sunnyvale/update.json -F 'count=10'
|
||||||
|
|
||||||
<a name="example-php"></a>
|
<a name="example-php"></a>
|
||||||
|
|
||||||
#### PHP (using [openphoto-php][openphoto-php])
|
#### PHP (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
||||||
|
@ -77,6 +82,7 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--->
|
||||||
|
|
||||||
[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
|
[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
|
||||||
[purpose]: #purpose
|
[purpose]: #purpose
|
||||||
|
|
|
@ -51,6 +51,8 @@ Every API endpoint returns a JSON response in a [standard envelope](http://theop
|
||||||
Get a user's tags.
|
Get a user's tags.
|
||||||
1. [POST /tag/create.json](http://theopenphotoproject.org/documentation/api/PostTagCreate)
|
1. [POST /tag/create.json](http://theopenphotoproject.org/documentation/api/PostTagCreate)
|
||||||
Create a tag for the user.
|
Create a tag for the user.
|
||||||
|
1. [POST /tag/:id/delete.json](http://theopenphotoproject.org/documentation/api/PostTagDelete)
|
||||||
|
Delete a tag.
|
||||||
1. [POST /tag/:id/update.json](http://theopenphotoproject.org/documentation/api/PostTagUpdate)
|
1. [POST /tag/:id/update.json](http://theopenphotoproject.org/documentation/api/PostTagUpdate)
|
||||||
Modify meta data for a user's tag.
|
Modify meta data for a user's tag.
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ Schema for a Tag object
|
||||||
|
|
||||||
A Tag object stores information about a specific tag.
|
A Tag object stores information about a specific tag.
|
||||||
This includes but is not limited to the number of objects containing this tag.
|
This includes but is not limited to the number of objects containing this tag.
|
||||||
The Tag objects schema is loose meaning that it can be flexible but at minimum it contains an `id` and `count`.
|
The Tag objects schema is loose meaning that it can be flexible but at minimum it contains an `id`, `count`, `actor` and `owner`.
|
||||||
|
|
||||||
For example, the tag `sunnyvale` can have a `latitude` and `longitude` property.
|
There are not currently any optional tag attributes.
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
@ -19,9 +19,8 @@ For example, the tag `sunnyvale` can have a `latitude` and `longitude` property.
|
||||||
{
|
{
|
||||||
id: (string),
|
id: (string),
|
||||||
count: (int),
|
count: (int),
|
||||||
email: (string),
|
actor: (string),
|
||||||
latitude: (float),
|
owner: (string),
|
||||||
longitude: (float)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
@ -30,9 +29,8 @@ For example, the tag `sunnyvale` can have a `latitude` and `longitude` property.
|
||||||
|
|
||||||
* id, Base 36 value of a base 10 auto-incremented value
|
* id, Base 36 value of a base 10 auto-incremented value
|
||||||
* count, The number of objects with this tag
|
* count, The number of objects with this tag
|
||||||
* email, Email address if applicable
|
* actor, Email address of the tag actor
|
||||||
* latitude, Latitude if applicable
|
* owner, Email address of the tag owner
|
||||||
* longitude, Longitude if applicable
|
|
||||||
|
|
||||||
[User]: http://theopenphotoproject.org/documentation/schemas/User
|
[User]: http://theopenphotoproject.org/documentation/schemas/User
|
||||||
[Photo]: http://theopenphotoproject.org/documentation/schemas/Photo
|
[Photo]: http://theopenphotoproject.org/documentation/schemas/Photo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue