Authorization
In order to use the AppMetrica API, you need to get an access token from the Yandex.OAuth service. The token must be sent with all method requests in the HTTP Authorization
header.
Example:
curl -X GET \ https://api.appmetrica.yandex.ru/management/v1/applications \ -H 'Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037'
Copied to clipboard
GET /management/v1/applications HTTP/1.1 Host: api.appmetrica.yandex.ru Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037
Copied to clipboard
Attention. Sending the token in the URL parameters is not supported.
If an API method is called without a token, or the request includes an invalid token, the server returns the HTTP status 401 Unauthorized
.
Obtaining the OAuth token
To get an access token:
- Go to the app creation page.
- Enter the service name. Attach its icon (optional).
- In the App platforms section, select Web services. In the Redirect URI field, click Enter URL for debugging.
- In the Data access section, specify appmetrica:read and appmetrica:write. Enter access names from the beginning of the line, without a space.
- Specify a contact email address. At the bottom of the page, click Create app.
- Copy the ID of your app in the ClientID block and paste it into the link to get a debug token:
https://oauth.yandex.ru/authorize?response_type=token&client_id=<app_id>
For more information, see OAuth documentation.