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.
|
||||
|
||||
_NOTE:_ OAuth2 isn't yet enabled.
|
||||
|
||||
### What's the response format?
|
||||
|
||||
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.
|
||||
1. [POST /photo/upload.json][PostPhotoUpload]
|
||||
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
|
||||
[GetPhotos]: api/GetPhotos.markdown
|
||||
[GetPhoto]: api/GetPhoto.markdown
|
||||
[GetTags]: api/GetTags.markdown
|
||||
[PostPhotoUpload]: api/PostPhotoUpload.markdown
|
||||
[PostTag]: api/PostTag.markdown
|
||||
[authentication]: api/Authentication.markdown
|
||||
[oauth2]: http://wiki.oauth.net/w/page/25236487/OAuth-2
|
Loading…
Add table
Add a link
Reference in a new issue