Authorization
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'
GET /management/v1/applications HTTP/1.1
Host: api.appmetrica.yandex.ru
Authorization: OAuth 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037
Alert
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 in Yandex ID.
Alert
Use the link from the instructions. Opening the page from Yandex ID doesn't provide an option to set up permissions.
-
Under General data, input the service name. Attach a service icon if needed.
-
In the App platforms section, select Web services. Other items are optional.
-
Hover over the Redirect URI field and click Enter URL for debugging.
Screenshot
-
In the Data access section, specify appmetrica:read and appmetrica:write. Enter access names from the beginning of the line, without a space.
Screenshot
-
Specify a contact email address. At the bottom of the page, click Create app to open the External app access window in Yandex ID.
-
Copy the ID of your app from the ClientID section.
Screenshot
-
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.
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.