Skip to content

Instantly share code, notes, and snippets.

@horte
Created June 26, 2013 14:56
Show Gist options
  • Save horte/5868046 to your computer and use it in GitHub Desktop.
Save horte/5868046 to your computer and use it in GitHub Desktop.
Saplo PHP Example
<?php
include "saplo4php-2.0.php"; //downloaded from https://github.com/saplo/saplo4php-2.0
//When creating the SaploAPI object ($client) you will automatically be authenticated.
$client = new SaploAPI("APIKEY", "SECRETKEY");
//You can also get your Access Token
echo $client->getAccessToken();
//Prints
/*
JSON-Request: {"method":"auth.accessToken","params":{"api_key":"APIKEY","secret_key":"SECRETKEY"},"id":0,"jsonrpc":"2.0"} JSON-Response: {"id":0,"result":{"access_token":"AT4837791421210358754"},"jsonrpc":"2.0"} AT4837791421210358754
*/
//Running on PHP Version 5.4.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment