Authorization

Authorization takes place at every request: you need to pass the OAuth token that's generated for the Yandex account for each method in the HTTP Authorization header.

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

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

Receiving a token

To receive a token:

  1. Go to the Create app page.

  2. Fill out the fields:

    • Service name;

    • Service icon — optional;

    • Platforms — add one or several 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. Add copied ClientID to a link such as https://oauth.yandex.com/authorize?response_type=token&client_id=<идентификатор приложения>.

  5. Go to the link and on the page that opens copy your authorization token.