Authorization

Every API request requires authorization. You have to pass the OAuth token generated for your Yandex account in the Authorization HTTP header for each method.

GET api/v1 HTTP/1.1
Host: adfox.yandex.ru
Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037

If an API method is called without a token or an invalid token is passed in the request, the server returns HTTP status 401 Unauthorized.

Getting a token

To get a token:

  1. Go to the Create app page.

  2. Fill in the fields:

    • Your service's name.

    • Service icon — optional.

    • Platforms — add one or more app platforms.

    • Redirect URL — specify https://oauth.yandex.ru/verification_code.

    • Data access — specify adfox:api.

    • Email address — optional.

  3. Click Create app and copy its ClientID .

  4. Append the copied ClientID to a URL structured like this: https://oauth.yandex.com/authorize?response_type=token&client_id=.

  5. Click the link and copy the OAuth token from the page that opens.