Related articles

Quick startAPI guides

Quick start

Introduction

In this guide, you will be shown the basics on how to get authenticated and make requests to the Enable API.

Authentication

In order to access the Enable API, you need to be authenticated. All requests must be authorised via a JSON Web Token (JWT). To generate this token, send a HTTP POST request to the token endpoint,

https://api.deal-track.com/oauth2/token

you will need to include the following credentials as

application/x-www-form-urlencoded

The encoded form data should contain:

  • client_id
  • client_secret
  • dealtrack_registration_id
  • scope
  • grant_type

To obtain these credentials, please contact Enable's Helpdesk. More information can be found on our Authentication page.

If your credentials are correct, the endpoint will return a valid JWT that you can use to authorise all your requests to the Enable API.

Read from the API

Now that you have your access token, you can try using it to make a GET request to the API. As an example, we will show how to send a request to get deal information from Enable by sending a HTTP GET request to https://api.deal-track.com/v1/deals.

In this request, you must send a request header that provides the JWT you received in the last step. The bearer token should be placed in the request header, with the key authorization and a prefix of “Bearer”:

KeyValue
Content-Typeapplication/vnd.api+json
AuthorizationBearer eyJhbGciOiJIUzI1...
curl --request GET "https://api.deal-track.com/v1/deals" --header "Authorization: Bearer eyJhbGciOiJIUzI1...."

If you were successfully authorised, the API should return you a JSON object containing a list of deals that looks something like this:

{ "data": [ { "attributes": { "dealType": "01 - Guaranteed Rebate", "startDate": "2019-01-01T00:00:00Z", "endDate": "2019-12-31T00:00:00Z", "reference": "Deal1", "description": "Deal1 2019", "notes": "Notes Deal1 - External notes", "latestTransactionDate": "2019-02-14T00:00:00Z", "contraEarnings": false, "modifiedBy": "Test User", "earningsModified": "2019-02-14T13:00:00.3970008+01:00", "postPeriod": 0, "paymentFrequency": 0, "claimPoint": null, "quarterlyWithInstalment": false }, "relationships": { "scheme": { "links": { "self": "/v1/deals/j1mt/relationships/scheme", "related": "/v1/deals/j1mt/scheme" } }, "items": { "links": { "self": "/v1/deals/j1mt/relationships/items", "related": "/v1/deals/j1mt/items" } } }, "type": "deals", "id": "j1mt" } ] }

Related data is provided in the “Relationships” section of the JSON returned. These URLs can be used to obtain related information to the entity returned.

Not useful
1
2
3
4
5
Very useful
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Still have questions?
Raise a ticket or contact our support team.