In addition to the API key, some Platts API datasets may require an access token to be included in every API request. This token can be generated using your S&P Global Single Sign-On (SSO) credentials via the Token Generation API endpoint.
Follow these steps to generate an access token and use it in Platts APIs.
1. Go to the Documentation Tab of Token Generation.
2. To use the Token Generation API endpoint, click the Authorize button and key in your API key. You may use the API key for the dataset that requires an access token. Once done, click on Authorize, then Close.
3. The /auth/api endpoint requires your S&P Global Single Sign-On credentials (email and password). Provide these details, then click Execute.
4. Scroll down to the Responses section; copy the access token as highlighted below quotation marks excluded.
5. On the same Service Catalog page, take a look at the left pane and review the list of available API datasets. Click on the dataset you are interested with, then click Authorize
6. On the apikey section, type in the API key specific for the dataset you are accessing. Click Authorize.
7. Scroll down to Bearer section, type bearer with a single space at the end (bearer ), then paste the access
token copied earlier. Click on Authorize, then Close.
8. Test if everything works by making an API request.
Steps to Refresh the token -
Note - A refresh token is not required for executing datasets through the Service Catalog. However, it becomes valuable during integration when users seek to extend the validity of their current token.
9. Navigate to the "Documentation" tab on the Token Generation page.
10. Locate and click on the "Refresh Token" endpoint. (Please ensure you have already completed the authorization process as mentioned in Step 2 above.)
11. The /auth/api/refresh endpoint requires the input parameter refresh_token which you can obtain from the authentication output (Step 4). Refer to the highlighted section below in the screenshot for clarity.
12. Execute the endpoint by providing the "refresh_token" as input.
13. Copy the access token as shown in the screenshot below (excluding the quotation marks).
14. You now have a refreshed access token, ready to access datasets. You can proceed with Steps 5 to 8 to access datasets using the new token, generated through the "Refresh Token" API.
For more information regarding your S&P Global SSO credentials, please refer to the attached guide.