Authentication service

The API key returned by the service must be used in all subsequent API calls. The API key remains valid until one of the following events:

  • No request using the API key is made for over 15 minutes.
  • The total number of currently open sessions exceeds the session limit configured for your account. A new session created in excess of the session limit invalidates the oldest currently open session.
  • Sessions can be invalidated after a maximum period of time by the REST API server. In such cases, invoke the authentication service with your credentials to obtain a new key.

Important: Applications should not rely on an API key remaining valid and should instead work on the assumption that an API key can be invalidated at any time. When an API key is invalidated, the correct response is to create a new API key and retry any failed requests with the new key. Applications should also be aware of the frequency of API key creation.

If API keys are being created very frequently (more than once per hour per process) this can indicate an issue, such as multiple processes on the client side attempting to create more parallel keys than allowed for your account.

Also remember that creating API keys more than once per second per account will result in HTTP 429 TOO_MANY_REQUESTS errors.

The Authentication Service is invoked by a POST request. The required username and password parameters should be passed in the message body with the Content-Type header set to application/x-www-form-urlencoded.

Note: S&P Global recommends sending username and password in the message body only. For enhanced security, future versions of the REST API service may disable submission of username and password in the URL query string.

  • URL: {ApiServerUrl}/apikey
  • Method: POST

Using the API key

The API key must be provided with all requests made to the Consumer API (excluding the initial request to obtain the API key). The recommended method to do this is by setting an Authorization header containing the API key as a Bearer token:

Authorization: Bearer <apikey>

For example, the following Python code sends a GET request to the Consumer API with the required header:

requests.get('https://api-uat.ihsmarkit.com' + path, headers={'Authorization': 'Bearer {}'.format(apikey)})

Tip: Due to browser Javascript limitations, the API uses an apikey cookie to pass the API key when the API is responding in interactive HTML format.

Back to help overview