The API is REST based. All requests must be made over HTTPS. All request and response body data is in JSON format.
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 OAuth 2 specification.
For details on generating an access Token, please see the Authentication Guide.
The Global Financials API is based on REST principles: data resources are accessed via standard HTTPS requests in UTF-8 format to an API endpoint. Where possible, the API strives to use appropriate HTTP verbs for each action:
VERB | DESCRIPTION |
---|---|
POST | Used for performing an action such as Authenticate or Search Financials |
For each API, the API Reference page includes URI, Verb used, description, code sample, request parameters, and response parameters.
The code sample is automatically generated from the request parameters. Code should be verified before use; all parameters are included in the sample, even if they are mutually exclusive.
All data is received as a JSON object. Responses for each API are documented on its API Reference page.
OAuth 2 Token based authentication. Valid client ID and secret key need to be used to access the tokens for enabling transactions through API.
Global Financials recomments Transport Security Layer version 1.2 (TLS 1.2)
We strongly recommend that you design your integration with the following guidelines in mind:
A successful error handling strategy requires that your integration recognize the difference between errors that can potentially be resolved by retrying the request and errors that should never be retried automatically. The HTTP status code that is returned with each response is your first indication as to the outcome of the request.
Error status code | Meaning | Retry? |
---|---|---|
2xx | Request was successful. | n/a |
4xx | A problem with the request prevented it from being executed successfully. | Never automatically retry the request. |
5xx | The request was properly formatted, but the operation failed on the application for run time scenarios mainly environmental errors. | In some scenarios, requests could be automatically retried using exponential backoff. In other cases, requests should not be retried. |
A list of error codes and recommendations for handling those are available under Resources: Error and Information Codes.
We strongly recommend that you design your integration such that it is capable of logging API requests and responses. Having access to the raw requests and responses (including detailed error codes and error messages) when API issues emerge will streamline troubleshooting and accelerate time to resolution.
The following examples show the type of information that your application should log for API requests and responses.
Request: verb, URI, header(s), request body
POST https://api.globalfinancials.com/generateToken
Authorization: TOKEN-VALUE
Content-Type: application/json
{
"documentID": "716dece0-a30a-4e0f-9619-b1cdc1e7eeb3",
"creationTimestamp": "2018-11-28T12:29:32.313+0000",
"requestType": "result",
"sessionID": "user908@bank.com",
"matchCriteria": {
"businessAddress": {
"countryCode": [ 111]
},
"numberOfEmployees": {
"fromValue": 10000
}
},
"pagination": {
"startRecordNumber": 1,
"numberOfRecords": 10
}
}
Response: HTTP status code, response body
200,
{
"documentID": "THORAPI_20190408104100017",
"requestID": "716dece0-a30a-4e0f-9619-b1cdc1e7eeb3",
"creationTimestamp": "2019-04-08 10:41:17.017Z",
"responseType": "result",
"transactionStatus": {
"isFailure": true,
"statusCode": "404",
"statusMessage": "No match found"
},
"pagination": {
"startRecordNumber": 1,
"numberOfRecords": 10
},
"sessionID": "user908@bank.com"
}
Should you encounter issues with the API while building an integration using a particular programming language (e.g., Java, C#, PHP, Python), keep the following troubleshooting techniques in mind: