The Divendo REST API uses the OAuth 2.0 protocol to authorise calls. OAuth is an open standard that many companies use to provide secure access to protected resources.
When you register a new API user, Divendo generates a set of OAuth client ID and secret credentials for your application. You pass these credentials in the Authorization header in a get access token request.
In exchange for these credentials, Divendo's authorisation server issues access tokens called bearer tokens that you use for authorisation when you make REST API requests. A bearer token enables you to complete actions on behalf of, and with the approval of, the resource owner.
Get an access token
To get an access token, you pass your OAuth credentials in a get access token call. In response, the Divendo authorisation server issues an access token which can be re-used until it expires. When the token expires, you can repeat this process to obtain a new token.
||The unique client_id assigned to your API user
||The unique client_secret assigned to your API user
||Always set to client_credentials
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Making REST API calls
With a valid access token, you can make REST API calls. This sample call returns a list of ISO country codes. The access token in the call is an OAuth bearer token.
curl -v https://api.divendo/data/countries \
-H "Content-Type: application/json" \
-H "Authorization: Bearer access_token"