Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smholloway/3ec23134be59d5bd9412 to your computer and use it in GitHub Desktop.
Save smholloway/3ec23134be59d5bd9412 to your computer and use it in GitHub Desktop.
require_once("toopher_api.php");
// Create an API object using your credentials
$toopherApi = new ToopherAPI($key, $secret);
// Authenticate a log in
$authStatus = $toopherApi->authenticate($pairingStatus['id'], "my computer");
// Once they've responded you can then check the status
while($authStatus['pending']){
$authStatus = $toopherApi->getAuthenticationStatus($authStatus['id']);
sleep(1);
}
if($authStatus['granted']){
// Success!
} else {
// user declined the authorization!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment