Obtain a token manually
You need to get an OAuth token manually to:
-
Access the API.
-
Test your app.
To obtain a token manually, open Yandex OAuth in the browser with the required parameters. Follow these steps:
-
When registering or editing your app, go to the App platforms step. In the Redirect URI field, enter
https://oauth.yandex.ru/verification_code. -
Log in to the Yandex account that the app will request access to.
-
Open a link that looks like this:
https://oauth.yandex.com/authorize?response_type=token&client_id=<app ID>The
Client_IDcan be found in the app properties. To view the properties, go to Yandex OAuth and click your app's name in the list. -
If you haven't granted access to this app before or the token has expired, you'll be taken to an access confirmation page. To confirm that you want to issue a token, click Allow.
Tokens you get manually can be revoked (just like any others).
Alert
Make sure to save the tokens you obtain. Yandex OAuth doesn't store issued tokens publicly. You won't be able to find them in your account.
If you didn't save a token, you can get it manually again.
Yandex OAuth redirects you to the token page, adding the token data after the # character:
https://oauth.yandex.com/verification_code#access_token=<new OAuth token>&expires_in=<token lifetime in seconds>
|
Parameter |
Description |
|
|
An OAuth token with the permissions you requested or specified when registering your app. |
|
|
Token lifetime in seconds. |
If the token couldn't be issued, the OAuth server adds an error code to the URL:
https://oauth.yandex.com/verification_code#error=<error code>
Error codes:
unauthorized_client: Returned if the app is blocked.