Authorization
- Copyright:
- 2015–2020 RewardOps Inc.
Members
object
# inner constant auth
Authorization token properties and actions object.
Properties:
Name | Type | Description |
---|---|---|
token |
Object
|
The current authorization token (retrieved from the API). |
getBaseUrl |
function
|
Get the base URL for the RewardOps authorization token. |
getTokenUrl |
function
|
Get the authorization token URL for the RewardOps API. |
getTokenPath |
function
|
Get the value of |
invalidateToken |
function
|
Invalidate (clear) the authorization token. |
getToken |
getToken
|
Get authorization token. |
# protected inner constant TOKEN_PATH
URL path for the authorization token in the RewardOps API.
Methods
# async protected inner getToken(config, callback)
Get authorization token.
Repeated calls to this function mid-stream are handled gracefully in order to prevent race conditions.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
object
|
Configuration object used by request function. |
|
clientId |
string
|
RewardOps API OAuth |
|
clientSecret |
string
|
RewardOps API OAuth |
|
timeout |
string
|
<optional> |
Timeout for HTTP requests (used by Request). |
callback |
module:api~requestCallback
|
Callback that handles the response. |
# async protected inner requestToken(requestOptions, retryStrategy, callback)
Safe request authorization token method.
If the initial responses have errors, a retry strategy is employed.
Parameters:
Name | Type | Description |
---|---|---|
requestOptions |
object
|
Options for a Request POST call. |
retryStrategy |
Object
|
Request retry strategy options. |
callback |
module:api~requestCallback
|
Callback that handles the response. |