Hello World ======================= ---------------------------------------- 1. [Purpose][purpose] 1. [Endpoint][endpoint] 1. [Parameters][parameters] 1. [Examples][examples] * [Command line][example-cli] * [PHP][example-php] 1. [Response][response] * [Sample][sample] ---------------------------------------- ### Purpose of the Get Hello World API This endpoint is used to test connectivity and/or authentication. Any parameters passed in the query string are returned in the response. ---------------------------------------- ### Endpoint _Authentication: optional_ GET /hello.json ### Parameters 1. auth (optional), Pass this in with a value of `true` to test OAuth requests. ---------------------------------------- ### Examples #### Command Line (using [openphoto-php][openphoto-php]) # 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' #### PHP (using [openphoto-php][openphoto-php]) // 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')); ---------------------------------------- ### 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_, _200_ on success * _result_, Any GET parameters passed in to the request plus `__route__`. #### Sample { "message":"Hello, world!", "code":200, "result": { "__route__":"\/hello.json" } } [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