auth.accessToken
Request a token for your account. Token is valid for 10 minutes if not being used.
Endpoint URL for getting a token is https://api.saplo.com/rpc/jsonRequest Parameters
| api_key | String (required) |
Your Saplo API key.
| secret_key | String (required) |
Your Saplo API secret key.
Response Parameters
| access_token | String (required) |
Your valid access token.
Code Examples
JSON
//Request
{
"method": "auth.accessToken",
"params":{
"api_key": "d41d8cd98f00b204e9800998ecf8427e",
"secret_key": "74be16979710d4c4e7c6647856088456"
}
}
//Response
{
"result":{
"access_token":"AT1982711345265993464N"
}
}
Java
//When creating the SaploClient object you will automatically be authenticated.
SaploClient client = new SaploClient("YOUR_API_KEY", "YOUR_SECRET_KEY");
//You can also get your Access Token
String myToken = client.getAccessToken();
PHP
//When creating the SaploAPI object ($client) you will automatically be authenticated.
$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");
//You can also get your Access Token
echo $client->getAccessToken();
Python
# When creating the SaploJSONClient object you will automatically be authenticated.
client = SaploJSONClient("YOUR API KEY", "YOUR SECRET KEY")
# You can also explicitly get your Access Token
print client.token
cURL
curl -d '{"method":"auth.accessToken","params":{"api_key":"API KEY","secret_key":"SECRET KEY"}}' 'http://api.saplo.com/rpc/json'
{"result":{"access_token":"AT8334226834920397662"}}
Notes
For being able to use Saplo API your API Account needs to be authorized using your API key pair.
When you have received a token it needs to be provided as parameter to the API endpoint URL for future calls (e.g. http://api.saplo.com/rpc/json?access_token=ACCESS_TOKEN)