Created
November 12, 2013 21:06
-
-
Save spookylukey/7438702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example using official client (condensed) | |
require_once('apiclient/pmapirequest.class.inc'); | |
require_once('apiclient/pmapiauthnone.class.inc'); | |
require_once('apiclient/pmapiauthtoken.class.inc'); | |
$request = new PMAPIRequest(new PMAPIAuthNone()); | |
$response = $request->token->post(array('username' => 'my_api_user@example.com', | |
'password' => 'my_strong_password')); | |
if($response->isError) | |
{ | |
die("Failed to obtain token: {$response->error}\n"); | |
} | |
$token = $response->data['token']; | |
$expiry = $response->data['expiry']; | |
$request = new PMAPIRequest(new PMAPIAuthToken($token)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment