2.3 KiB
2.3 KiB
Hello World
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
- auth (optional), Pass this in with a value of
true
to test OAuth requests.
Examples
Command Line (using 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)
// 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.
- 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"
}
}