Skip to content
Last updated

Authentication

You must authenticate every request to the Adfin API. Adfin supports two methods:

  • API keys. Use an API key to connect your own systems to your own Adfin account.
  • OAuth 2.0. Use OAuth 2.0 to connect your platform to the Adfin accounts of your users.
Which method to use

Use an API key if you connect only your own systems to your own Adfin account.

Use OAuth 2.0 if you build an integration for more than one Adfin account.

Choose a method

API keyOAuth 2.0
Recommended forConnecting your own systems, such as an ERP, a script or a data warehouse, to your own Adfin accountPlatforms and partners that connect to the Adfin accounts of their users
Accounts you can accessOnly the account that created the keyEach account that gives consent to your app
How you get the credentialsYou create the key in the Adfin ConsoleYour Adfin Integration Manager sends your client_id and client_secret
What you send with each requestThe API keyAn access token that expires after 1 hour
Lifetime90 days, 180 days or 12 months. You choose when you create the keyThe access token expires after 1 hour. A refresh token keeps the connection for up to 1 year
PermissionsThe permissions that you give the keyThe scopes that the account owner approves

Environments

Adfin has two environments. Credentials from one environment do not work in the other environment.

EnvironmentAPI base URL
Staginghttps://api.staging.adfin.com/api
Productionhttps://api.adfin.com/api

Test your integration in staging before you use production.

Send the credentials

Both methods use the HTTP Authorization header with the Bearer scheme:

Authorization: Bearer {your_access_token_or_api_key}

Send all requests over HTTPS. Do not put credentials in a URL or a query parameter.