Create a Production Access Token
To create an OAuth access token in either the UAT or production environments, you can use any tool that can submit HTTP requests, like Postman, etc. This example shows how to create a token using curl
.
To create a request, you will need the appropriate API key and secret. Your developer portal login should provide you access to UAT keys and secrets (How to get keys for the UAT environment), while your Netspend Product Management point of contact (POC) should provide you with a production key and secret.
Pass the API key and secret in the Authorization
header to the /netspend-api/v1/oauth/accesstoken
endpoint.
To form the header:
- Combine the API key and secret, separated by a colon. Example:
apikey:secret
- Base64-encode the combination, then pass the result in the
Authorization
header as in the following example.
Request Example
curl -L -X POST 'https://apis.netspend.com class="brnodisplay" /netspend-api/v1/oauth/accesstoken'
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'Authorization: Basic RzNTMmJYdkJVMGZUelpSUmFuR0F4cFlCYjY2ejVuWEQ6ODhYZkdqa3VD eThuMWt0SQ=='
-- data-urlencode 'grant_type=client_credentials'
Response Example
{
"access_token":"Nl6K9cBs IjG1mF9CnqOAjJesIOQn",
"token_type":"BearerToken",
"scope":"owned_accounts_full",
"expires_in":"86399",
}
After you obtain the access token, you can use it in your applications for all calls to the Netspend API.
Updated 12 months ago