Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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