Links

How to get a Project access token

Prerequisites

Create a project in the Dashboard and retrieve your client_id and client_secret in the API Credential Menu.

Retrieve access tokens

You can retrieve an access_token for your project with the Token API, using your client_secret, which you received with your client_id.
Example OAuth Token request
curl -v -X POST <https://oauth.swan.io/oauth2/token> \\
-d "client_id={YOUR_CLIENT_ID}" \\
-d "client_secret={YOUR_CLIENT_SECRET}" \\
-d "grant_type=client_credentials"
If you provided the correct client_id and client_secret, you should get a successful response with an access_token.
Example OAuth Token response
{
"access_token": "{YOUR_USER_ACCESS_TOKEN}",
"token_type": "bearer",
"expires_in": 3600,
"scope": ""
}

In case of errors

If you get an error here, such as 401 Unauthorized, this could have multiple reasons. It could for example be an invalid client_secret