AccessToken Class
This class is a Simplify domain object used for OAuth transactions.
var client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.accesstoken.METHOD_NAME(params, function(error, data){
if(error){
// handle the error
}
// Awesome...no error, handle the data
});
Methods
create
-
params
-
callback
Function to create an access token.
Parameters:
-
params
ObjectA map of parameters to create an access token.
Valid parameters include:- authCode : Code return from a successful OAuth authorization (REQUIRED)
- redirectUri : URI that must match the URI saved on account (REQUIRED)
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
refresh
-
refreshToken
-
callback
Function to refresh an access token.
Parameters:
-
refreshToken
StringA refresh token returned with an oauth response
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
revoke
-
accessToken
-
callback
Function to revoke an access token.
Parameters:
-
accessToken
StringThe access token to revoke
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.