Adding documentation for GET Tags API.
This commit is contained in:
parent
b9e91df9b7
commit
50fffcc880
4 changed files with 129 additions and 9 deletions
107
documentation/api/GetTags.markdown
Normal file
107
documentation/api/GetTags.markdown
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
Open Photo API / Get Photos
|
||||||
|
=======================
|
||||||
|
#### OpenPhoto, a photo service for the masses
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
1. [Purpose][purpose]
|
||||||
|
1. [Endpoint][endpoint]
|
||||||
|
1. [Parameters][parameters]
|
||||||
|
1. [Examples][examples]
|
||||||
|
* [Curl][example-curl]
|
||||||
|
* [PHP][example-php]
|
||||||
|
1. [Response][response]
|
||||||
|
* [Sample][sample]
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="purpose"></a>
|
||||||
|
### Purpose of the Get Tags API
|
||||||
|
|
||||||
|
Use this API to get a user's tags.
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="endpoint"></a>
|
||||||
|
### Endpoint
|
||||||
|
|
||||||
|
_Authentication: required_
|
||||||
|
|
||||||
|
GET /tags.json
|
||||||
|
|
||||||
|
<a name="parameters"></a>
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
_None_
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="examples"></a>
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
<a name="example-curl"></a>
|
||||||
|
#### Command line curl
|
||||||
|
|
||||||
|
curl "http://jmathai.openphoto.me/tags.json"
|
||||||
|
|
||||||
|
<a name="example-php"></a>
|
||||||
|
#### PHP
|
||||||
|
|
||||||
|
$ch = curl_init('http://jmathai.openphoto.me/tags.json');
|
||||||
|
curl_exec($ch);
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
<a name="response"></a>
|
||||||
|
### Response
|
||||||
|
|
||||||
|
The response is in a standard [response envelope][Envelope].
|
||||||
|
|
||||||
|
* _message_, A string describing the result. Don't use this for anything but reading.
|
||||||
|
* _code_, _200_ on success
|
||||||
|
* _result_, An array of [Tag][Tag] objects
|
||||||
|
|
||||||
|
<a name="sample"></a>
|
||||||
|
#### 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
|
||||||
|
},
|
||||||
|
....
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[Envelope]: api/Envelope.markdown
|
||||||
|
[Tag]: schemas/Tag.markdown
|
||||||
|
[purpose]: #purpose
|
||||||
|
[endpoint]: #endpoint
|
||||||
|
[parameters]: #parameters
|
||||||
|
[examples]: #examples
|
||||||
|
[example-curl]: #example-curl
|
||||||
|
[example-php]: #example-php
|
||||||
|
[response]: #response
|
||||||
|
[sample]: #sample
|
||||||
|
|
|
@ -8,6 +8,8 @@ Open Photo API
|
||||||
|
|
||||||
The Open Photo API uses [OAuth2][oauth2] for authentication. See the complete [guide on authentication][authentication] for details.
|
The Open Photo API uses [OAuth2][oauth2] for authentication. See the complete [guide on authentication][authentication] for details.
|
||||||
|
|
||||||
|
_NOTE:_ OAuth2 isn't yet enabled.
|
||||||
|
|
||||||
### What's the response format?
|
### What's the response format?
|
||||||
|
|
||||||
Every API endpoint returns a JSON response in a [standard envelope][Envelope].
|
Every API endpoint returns a JSON response in a [standard envelope][Envelope].
|
||||||
|
@ -28,10 +30,16 @@ Every API endpoint returns a JSON response in a [standard envelope][Envelope].
|
||||||
Get a user's photo.
|
Get a user's photo.
|
||||||
1. [POST /photo/upload.json][PostPhotoUpload]
|
1. [POST /photo/upload.json][PostPhotoUpload]
|
||||||
Upload a new photo.
|
Upload a new photo.
|
||||||
|
1. [GET /tags.json][GetTags]
|
||||||
|
Get a user's tags.
|
||||||
|
1. [POST /tag/:id.json][PostTag]
|
||||||
|
Modify meta data for a user's tag.
|
||||||
|
|
||||||
[Envelope]: api/Envelope.markdown
|
[Envelope]: api/Envelope.markdown
|
||||||
[GetPhotos]: api/GetPhotos.markdown
|
[GetPhotos]: api/GetPhotos.markdown
|
||||||
[GetPhoto]: api/GetPhoto.markdown
|
[GetPhoto]: api/GetPhoto.markdown
|
||||||
|
[GetTags]: api/GetTags.markdown
|
||||||
[PostPhotoUpload]: api/PostPhotoUpload.markdown
|
[PostPhotoUpload]: api/PostPhotoUpload.markdown
|
||||||
|
[PostTag]: api/PostTag.markdown
|
||||||
[authentication]: api/Authentication.markdown
|
[authentication]: api/Authentication.markdown
|
||||||
[oauth2]: http://wiki.oauth.net/w/page/25236487/OAuth-2
|
[oauth2]: http://wiki.oauth.net/w/page/25236487/OAuth-2
|
|
@ -33,9 +33,9 @@ This includes EXIF information from the photo, tags and URLs to all versions of
|
||||||
exifMeteringMode: (string),
|
exifMeteringMode: (string),
|
||||||
exifFlash: (string),
|
exifFlash: (string),
|
||||||
exifFocalLength: (string),
|
exifFocalLength: (string),
|
||||||
gpsAltitude: (int),
|
altitude: (int),
|
||||||
gpsLatitude: (float),
|
latitude: (float),
|
||||||
gpsLongitude: (float),
|
longitude: (float),
|
||||||
views: (int),
|
views: (int),
|
||||||
status: (int), // binary
|
status: (int), // binary
|
||||||
permission: (int), // bitwise
|
permission: (int), // bitwise
|
||||||
|
|
|
@ -18,7 +18,10 @@ For example, the tag `sunnyvale` can have a `latitude` and `longitude` property.
|
||||||
|
|
||||||
{
|
{
|
||||||
id: (string),
|
id: (string),
|
||||||
count: (int)
|
count: (int),
|
||||||
|
email: (string),
|
||||||
|
latitude: (float),
|
||||||
|
longitude: (float)
|
||||||
}
|
}
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
@ -27,9 +30,11 @@ 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
|
||||||
|
* latitude, Latitude if applicable
|
||||||
|
* longitude, Longitude if applicable
|
||||||
|
|
||||||
[User]: https://github.com/openphoto/frontend/blob/master/documentation/schemas/User.markdown
|
[User]: User.markdown
|
||||||
[Photo]: https://github.com/openphoto/frontend/blob/master/documentation/schemas/Photo.markdown
|
[Photo]: Photo.markdown
|
||||||
[Action]: https://github.com/openphoto/frontend/blob/master/documentation/schemas/Action.markdown
|
[Action]: Action.markdown
|
||||||
[Tag]: https://github.com/openphoto/frontend/blob/master/documentation/schemas/Tag.markdown
|
[Tag]: Tag.markdown
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue