Members
(protected, inner, constant) TOKEN_PATH
URL path for the authorization token in the RewardOps API.
(inner, constant) auth :object
Authorization token properties and actions object.
Type:
- 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. |
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 | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object | Configuration object used by request function. Properties
|
||||||||||||||||
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. |