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 <your_token>'
where <your_token>
is an OAuth token that can be obtained using instructions.
GET /management/v1/applications HTTP/1.1
Host: api.appmetrica.yandex.ru
Authorization: OAuth <your_token>
where <your_token>
is an OAuth token that can be obtained using instructions.
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.
Use the link from the instructions. Opening the page from Yandex ID doesn't provide an option to set up permissions.
-
Specify a contact email address. At the bottom of the page, click Create app to open the External app access window in Yandex ID.
-
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.
-
In the Redirect URI field, enter the address
https://oauth.yandex.ru/verification_code
.Screenshot
-
In the Data access section, specify appmetrica:read and appmetrica:write. To see the premissions in the dropdown, begin typing their name.
Screenshot
-
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.