Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/api/GetTags.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,26 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
{
"id": "mountain",
"count": 1
"actor": "jaisen@jmathai.com"
"owner": "jaisen@jmathai.com"
},
{
"id": "jaisen",
"count": 10,
"email": "jaisen@jmathai.com"
"actor": "jaisen@jmathai.com"
"owner": "jaisen@jmathai.com"
},
{
"id": "New York",
"count": 9,
"latitude": 12.3456,
"longitude": 78.9012
"actor": "jaisen@jmathai.com"
"owner": "jaisen@jmathai.com"
},
{
"id": "Sunnyvale",
"count":23
"latitude": 13.579,
"longitude": 24.68
"actor": "jaisen@jmathai.com"
"owner": "jaisen@jmathai.com"
},
....
]
Expand Down
14 changes: 4 additions & 10 deletions docs/api/PostTagCreate.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Create Tag
<a name="purpose"></a>
### 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.

----------------------------------------

Expand All @@ -34,9 +35,6 @@ _Authentication: required_

1. tag (required), The name of the tag to create
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.

----------------------------------------

Expand All @@ -63,19 +61,15 @@ 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.
* _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>
#### Sample

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


Expand Down
83 changes: 83 additions & 0 deletions docs/api/PostTagDelete.markdown
Original file line number Diff line number Diff line change
@@ -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

14 changes: 10 additions & 4 deletions docs/api/PostTagUpdate.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ Update Tag
1. [Purpose][purpose]
1. [Endpoint][endpoint]
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]
* [Command line][example-cli]
* [PHP][example-php]
1. [Response][response]
* [Sample][sample]
--->

----------------------------------------

Expand All @@ -32,22 +35,24 @@ _Authentication: required_
<a name="parameters"></a>
### Parameters

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.
There are not currently any tag attributes that can be updated.

----------------------------------------

<!--- 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>
### Examples

<a name="example-cli"></a>

#### Command Line (using [openphoto-php][openphoto-php])

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

<a name="example-php"></a>

#### PHP (using [openphoto-php][openphoto-php])

$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
Expand Down Expand Up @@ -77,6 +82,7 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
}
}

--->

[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
[purpose]: #purpose
Expand Down
2 changes: 2 additions & 0 deletions docs/api/Readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Every API endpoint returns a JSON response in a [standard envelope](http://theop
Get a user's tags.
1. [POST /tag/create.json](http://theopenphotoproject.org/documentation/api/PostTagCreate)
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)
Modify meta data for a user's tag.

Expand Down
14 changes: 6 additions & 8 deletions docs/schemas/Tag.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Schema for a Tag object

A Tag object stores information about a specific 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.

----------------------------------------

Expand All @@ -19,9 +19,8 @@ For example, the tag `sunnyvale` can have a `latitude` and `longitude` property.
{
id: (string),
count: (int),
email: (string),
latitude: (float),
longitude: (float)
actor: (string),
owner: (string),
}

----------------------------------------
Expand All @@ -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
* count, The number of objects with this tag
* email, Email address if applicable
* latitude, Latitude if applicable
* longitude, Longitude if applicable
* actor, Email address of the tag actor
* owner, Email address of the tag owner

[User]: http://theopenphotoproject.org/documentation/schemas/User
[Photo]: http://theopenphotoproject.org/documentation/schemas/Photo
Expand Down