Updating documentation for OAuth.
Gh-194
This commit is contained in:
parent
a379452158
commit
46b2c85f55
4 changed files with 52 additions and 26 deletions
|
@ -76,27 +76,30 @@ Every API endpoint returns a JSON response in a [standard envelope][Envelope].
|
||||||
1. [POST /webhook/:id/update.json][PostWebHookUpdate]
|
1. [POST /webhook/:id/update.json][PostWebHookUpdate]
|
||||||
Update an eixsting webhook.
|
Update an eixsting webhook.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
;[PostTag]: PostTag.markdown
|
||||||
|
;[PostGroupCreate]: PostGroupCreate.markdown
|
||||||
|
;[PostGroupDelete]: PostGroupDelete.markdown
|
||||||
|
;[PostGroupUpdate]: PostGroupUpdate.markdown
|
||||||
|
;[GetGroup]: GetGroup.markdown
|
||||||
|
;[GetGroups]: GetGroups.markdown
|
||||||
|
;[PostWebhookCreate]: PostWebhookCreate.markdown
|
||||||
|
;[PostWebhookDelete]: PostWebhookDelete.markdown
|
||||||
|
;[PostWebhookUpdate]: PostWebhookUpdate.markdown
|
||||||
|
;[GetWebhook]: GetWebhook.markdown
|
||||||
|
;[GetWebhooks]: GetWebhooks.markdown
|
||||||
|
;[PostActionCreate]: PostActionCreate.markdown
|
||||||
|
;[PostActionDelete]: PostActionDelete.markdown
|
||||||
|
;[PostPhotoDelete]: PostPhotoDelete.markdown
|
||||||
|
;[PostPhotoUpdate]: PostPhotoUpdate.markdown
|
||||||
|
-->
|
||||||
|
|
||||||
[Envelope]: Envelope.markdown
|
[Envelope]: Envelope.markdown
|
||||||
[GetHelloWorld]: GetHelloWorld.markdown
|
[GetHelloWorld]: GetHelloWorld.markdown
|
||||||
[PostActionCreate]: PostActionCreate.markdown
|
|
||||||
[PostActionDelete]: PostActionDelete.markdown
|
|
||||||
[PostPhotoDelete]: PostPhotoDelete.markdown
|
|
||||||
[GetPhotos]: GetPhotos.markdown
|
[GetPhotos]: GetPhotos.markdown
|
||||||
[GetPhoto]: GetPhoto.markdown
|
[GetPhoto]: GetPhoto.markdown
|
||||||
[PostPhotoUpdate]: PostPhotoUpdate.markdown
|
|
||||||
[PostPhotoUpload]: PostPhotoUpload.markdown
|
[PostPhotoUpload]: PostPhotoUpload.markdown
|
||||||
[GetPhotoNextPrevious]: GetPhotoNextPrevious.markdown
|
[GetPhotoNextPrevious]: GetPhotoNextPrevious.markdown
|
||||||
[GetTags]: GetTags.markdown
|
[GetTags]: GetTags.markdown
|
||||||
[PostTag]: PostTag.markdown
|
|
||||||
[PostGroupCreate]: PostGroupCreate.markdown
|
|
||||||
[PostGroupDelete]: PostGroupDelete.markdown
|
|
||||||
[PostGroupUpdate]: PostGroupUpdate.markdown
|
|
||||||
[GetGroup]: GetGroup.markdown
|
|
||||||
[GetGroups]: GetGroups.markdown
|
|
||||||
[PostWebhookCreate]: PostWebhookCreate.markdown
|
|
||||||
[PostWebhookDelete]: PostWebhookDelete.markdown
|
|
||||||
[PostWebhookUpdate]: PostWebhookUpdate.markdown
|
|
||||||
[GetWebhook]: GetWebhook.markdown
|
|
||||||
[GetWebhooks]: GetWebhooks.markdown
|
|
||||||
[authentication]: Authentication.markdown
|
[authentication]: Authentication.markdown
|
||||||
[oauth1.0a]: http://oauth.net/core/1.0a/
|
[oauth1.0a]: http://oauth.net/core/1.0a/
|
||||||
|
|
|
@ -4,3 +4,18 @@ Open Photo API / Authentication
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
### Using OAuth (1.0a)
|
||||||
|
|
||||||
|
A full introduction to OAuth is beyond the scope of the OpenPhoto documentation.
|
||||||
|
In all reality you probably don't need to understand the ins and outs of OAuth, just grab one of our libraries.
|
||||||
|
|
||||||
|
* <a href="https://github.com/openphoto/openphoto-php">openphoto/openphoto-php</a> - Our PHP language binding.
|
||||||
|
* More coming soon, <a href="mailto:hello@openphoto.me">contact us</a> if you'd like to write bindings in an unlisted language.
|
||||||
|
|
||||||
|
### Resources on the web
|
||||||
|
|
||||||
|
If you're interested in learning more about OAuth then the following links are a great place to start.
|
||||||
|
|
||||||
|
* http://oauth.net/documentation/getting-started/
|
||||||
|
* http://hueniverse.com/oauth/guide/intro/
|
||||||
|
* http://www.slideshare.net/eran/introduction-to-oauth-presentation
|
||||||
|
|
|
@ -8,7 +8,7 @@ Open Photo API / Hello World
|
||||||
1. [Endpoint][endpoint]
|
1. [Endpoint][endpoint]
|
||||||
1. [Parameters][parameters]
|
1. [Parameters][parameters]
|
||||||
1. [Examples][examples]
|
1. [Examples][examples]
|
||||||
* [Curl][example-curl]
|
* [Command line][example-cli]
|
||||||
* [PHP][example-php]
|
* [PHP][example-php]
|
||||||
1. [Response][response]
|
1. [Response][response]
|
||||||
* [Sample][sample]
|
* [Sample][sample]
|
||||||
|
@ -39,17 +39,25 @@ _Authentication: optional_
|
||||||
<a name="examples"></a>
|
<a name="examples"></a>
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
<a name="example-curl"></a>
|
<a name="example-cli"></a>
|
||||||
#### Command line curl
|
#### Command Line (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
curl "http://jmathai.openphoto.me/hello.json"
|
# without authentication
|
||||||
curl "http://jmathai.openphoto.me/hello.json?auth=true"
|
./openphoto -p -h current.openphoto.me -e /hello.json
|
||||||
|
|
||||||
|
# with authentication
|
||||||
|
./openphoto -p -h current.openphoto.me -e /hello.json -F 'auth=true'
|
||||||
|
|
||||||
<a name="example-php"></a>
|
<a name="example-php"></a>
|
||||||
#### PHP
|
#### PHP (using [openphoto-php][openphoto-php])
|
||||||
|
|
||||||
$ch = curl_init('http://jmathai.openphoto.me/hello.json');
|
// without authentication
|
||||||
curl_exec($ch);
|
$client = new OpenPhotoOAuth($host);
|
||||||
|
$response = $client->get("/hello.json");
|
||||||
|
|
||||||
|
// with authentication
|
||||||
|
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
|
||||||
|
$response = $client->get("/hello.json", array('auth' => 'true'));
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
@ -79,9 +87,8 @@ The response is in a standard [response envelope][Envelope].
|
||||||
[endpoint]: #endpoint
|
[endpoint]: #endpoint
|
||||||
[parameters]: #parameters
|
[parameters]: #parameters
|
||||||
[examples]: #examples
|
[examples]: #examples
|
||||||
[example-curl]: #example-curl
|
[example-cli]: #example-cli
|
||||||
[example-php]: #example-php
|
[example-php]: #example-php
|
||||||
[response]: #response
|
[response]: #response
|
||||||
[sample]: #sample
|
[sample]: #sample
|
||||||
|
[openphoto-php]: https://github.com/openphoto/openphoto-php
|
||||||
|
|
||||||
|
|
1
documentation/api/PostPhotoUpdate.markdown
Normal file
1
documentation/api/PostPhotoUpdate.markdown
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Not yet documented
|
Loading…
Add table
Add a link
Reference in a new issue