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]
|
||||
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
|
||||
[GetHelloWorld]: GetHelloWorld.markdown
|
||||
[PostActionCreate]: PostActionCreate.markdown
|
||||
[PostActionDelete]: PostActionDelete.markdown
|
||||
[PostPhotoDelete]: PostPhotoDelete.markdown
|
||||
[GetPhotos]: GetPhotos.markdown
|
||||
[GetPhoto]: GetPhoto.markdown
|
||||
[PostPhotoUpdate]: PostPhotoUpdate.markdown
|
||||
[PostPhotoUpload]: PostPhotoUpload.markdown
|
||||
[GetPhotoNextPrevious]: GetPhotoNextPrevious.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
|
||||
[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. [Parameters][parameters]
|
||||
1. [Examples][examples]
|
||||
* [Curl][example-curl]
|
||||
* [Command line][example-cli]
|
||||
* [PHP][example-php]
|
||||
1. [Response][response]
|
||||
* [Sample][sample]
|
||||
|
@ -39,17 +39,25 @@ _Authentication: optional_
|
|||
<a name="examples"></a>
|
||||
### Examples
|
||||
|
||||
<a name="example-curl"></a>
|
||||
#### Command line curl
|
||||
<a name="example-cli"></a>
|
||||
#### Command Line (using [openphoto-php][openphoto-php])
|
||||
|
||||
curl "http://jmathai.openphoto.me/hello.json"
|
||||
curl "http://jmathai.openphoto.me/hello.json?auth=true"
|
||||
# without authentication
|
||||
./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>
|
||||
#### PHP
|
||||
#### PHP (using [openphoto-php][openphoto-php])
|
||||
|
||||
$ch = curl_init('http://jmathai.openphoto.me/hello.json');
|
||||
curl_exec($ch);
|
||||
// without authentication
|
||||
$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
|
||||
[parameters]: #parameters
|
||||
[examples]: #examples
|
||||
[example-curl]: #example-curl
|
||||
[example-cli]: #example-cli
|
||||
[example-php]: #example-php
|
||||
[response]: #response
|
||||
[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