Products

Velcome to the Products API.

The products API provides endpoints for generating offers, fetching, creating and changing datamanaged objects.

 

Headers

Authentication

The endpoints concerning datamanaged objects is protected by Auth0, which means that you'll need an API Key to access them.
To get an access token from Auth0 you can do as follows:

curl --request POST \
  --url 'https://partner.staging.entur.org/oauth/token' \
  --header 'content-type: application/json' \
  --data '{"grant_type":"client_credentials","client_id": "<clientid>","client_secret": "<clientsecret>","audience": "https://api.staging.entur.io"}

In the output, locate the access_token value.

If you wish to extract the access token directly into a shell variable, do this:

export TOKEN=$(curl --request POST \
  --url 'https://partner.staging.entur.org/oauth/token' \
  --header 'content-type: application/json' \
  --data '{"grant_type":"client_credentials","client_id": "<clientid>","client_secret": "<clientsecret>","audience": "https://api.staging.entur.io"}\
  | jq .access_token | sed -e 's/"//g')

 

Language code

Most datamanaged objects have a name and description in several languages. It is possible to get it in a certain language by adding "Accept-Language" key in the header with a code for the language. It is not possible to specify multiple languages. However, if none is specified, name and description will appear in all available languages.

Example

Description Header key Example value
Language code Accept-Language nob
Authorization Authorization  Bearer xxxxxxx.yyyyyyyy.zzzzzzzzz

 

Guides for products will be published at a later time.

The API reference(s) can be found here: