Authentication

To use the App API, your client will have to authenticate itself to our API.

Authentication is handled by a combination of instance key and access token. These have to be provided with every request to the App API.

Create an access token

Access tokens are managed in the app. Go to the Settings → API Keys.

To create a new access token, use + New to create a new access token. Enter a name and hit save:

Choose a name that will make it easy to recognise for what purpose you're using the token. This allows you to easily identify and revoke a specific token if it is compromised or no longer needed, without disrupting your other active integrations.

The generated token will be displayed one-time only. Copy it and keep it safe!

The message will self-destruct after being viewed. The token can only be accessed once.

Example

To make a request to the App API, you'll need to provide both an instance key and an access token. Both of these values must be provided in the headers:

  • TWN-InstanceKey: the instance key
  • TWN-Authentication: the created access token

Note: you can find your instancekey on your Tweakwise App Dashboard

Example, using cURL:

curl --request GET \
     --url https://navigator-api.tweakwise.com/stats/totalproducts \
     --header 'TWN-InstanceKey: YourInstanceKeyHere' \
     --header 'TWN-Authentication: YourAccessTokenHere'