Authentication

Before issuing any request against a Global Financial endpoint, you must obtain an Access Token. For obtaining access token , you must have a consumer key and a consumer secret which will be unique to you. If you have not already received a consumer key and secret, contact your Dun & Bradstreet representative.

Once you have an unique consumer key and secret, you can use Authorization API as described in this section below to obtain access token. Once the access Token is obtained, the same token can be used for all subsequent requests for the next 4 hours, after which it will be expired and won't be usable in order to avoid the over use of consumer keys online (for security purpose). It is recommended that a new token (refresh token) should be generated before expiry of access token (4 hours), the procedure of which is explained in this section below.

IMPORTANT: Your consumer key, consumer secret, and access/refresh token should be considered as sensitive as a password, and must be used only by authorized parties as stated in the API agreement.

API Authentication

Global Financials API calls utilize access tokens, generated from a consumer key/secret combination, for authentication (based on the Client Credentials Grant flow of the OAuth2 specification).
Here is a sample of a Consumer Key and Consumer Secret.

  • CONSUMER-KEY: o1BSFi9iRGl0FP623H7Xm6YHY2yUDH6H
  • CONSUMER-SECRET: juHIUiKJRLqAc66

Note: These are just for sample purpose and are not valid credentials. If you are new to Global Financials, contact support desk WWNHelp@DNB.com for consumer credentials after setting up the contract.

There are two approaches to get tokens:

  • Generate Token
  • Refresh Token

Generate Token

For any initial calls from your server, you have to use this endpoint service to generate access tokens. And for all subsequent calls before the expiry of these tokens (the period of which is 4 hours), use the Refresh Token endpoint in order to avoid the over use of consumer keys online . Below, we have summarised on how to invoke the Generate Token endpoint.

Below is the request format to generate initial token:

Request: verb, URI, header(s)


	POST, https://api.globalfinancials.com/gettoken ,
	Content-Type: application/json
	Authorization:BASE64 encoded value of client_id:CONSUMER-KEY,client_secret:CONSUMER-SECRET
	

Response: HTTP status code, response body


	200,
	{
		"access_token":"TOKEN-VALUE",
		"refresh_token": "REFRESH-TOKEN-VALUE"	
	}

Refresh Token

Once you get an access token, you must use this endpoint to generate a new refresh token before the access token is expired (4 hours). The expiry time for the new refresh tokens received in the response will also be 4 hours. So basically, after every 4 hours, you will have to invoke this endpoint in order to receive a new token.

Below is the request format to generate refresh token:

Request: verb, URI, header(s), HTTP body


	POST, https://api.globalfinancials.com/getrefreshtoken ,
	Content-Type: application/json
	Authorization: bearer:TOKEN-VALUE
	{
		"refresh_token": "REFRESH-TOKEN-VALUE"	
	}
	

Response: HTTP status code, response body


	200,
	{
		"access_token":"TOKEN",
		"refresh_token": "REFRESH-TOKEN"	
	}