FAQ KB0400928
Email
OpenAPI: How do I get a new access token using a refresh token?
Symptom

How do I use the refresh token to get a new access token for my OpenAPI integration after the initial token has expired or is about to expire?


Cause

The initial access token expires in 1440 seconds (24 minutes).


Resolution

To ensure the continuity of your API calls, you must generate a new access token by using the refresh token. A new token can only be generated if the initial access token has either Expired or is within 2 minutes of its expiration.

To get the new access token:

  1. Make a POST call to the same OAuth token URL you used to get the initial access token.
  2. Use the following parameters in your request:
    grant_type = refresh_token
    refresh_token = {value of the refresh token from the initial token call}

Below is the cURL command structure for this call.

curl -X POST \

'https://api.ariba.com/v2/oauth/token?grant_type=refresh_token&refresh_token={refreshtokenvalue}' \
-H 'Authorization: Basic {Base64 Secret Key}' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'

  • [refreshtokenvalue]: The value of the refresh_token you received in the initial authentication response.
  • [Base64 Secret Key]: Your application's Base64 encoded OAuth secret.


Note: The URL in the example is for the US data center. If you are using a different data center, you must replace the URL accordingly.



Applies To

Catalog Management > Catalog - REST API
Core Procurement > Procurement REST APIs
SAP Business Network for Procurement & Supply Chain > SAP Business Network REST APIs
Supplier Lifecycle & Performance > Supplier Lifecycle & Performance - Open API

Terms of Use  |  Copyright  |  Security Disclosure  |  Privacy