Quick start
App registration
-
Create an account in Yandex Direct that you will use as an application developer:
-
If you don't have a Yandex username, register.
-
In the Yandex Direct web interface, create an account : enter a valid email address, choose your country and currency, and click Get started.
-
On the API Settings page, click Get API access and accept the user agreement.
-
-
Register your app on the Yandex.OAuth server.
-
Submit a request for test access for your application. Wait for your request to be approved.
Debugging with test data
You can use your developer account as a test user. You can also create a special test user (repeat steps above).
- Get a debugging OAuth token on behalf of the test user.
- Enable the Sandbox, which is an application debugging environment where you can manage test campaigns without actual impressions and spending.
- Send HTTP POST requests to the Sandbox using the debugging token. Request example:
-H 'Authorization: Bearer 0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f' \ -H 'Accept-Language: en' \ -d ' { "method":"get", "params": { "SelectionCriteria": {}, "FieldNames": [ "Name", "DailyBudget", "Funds", "Statistics", "Type" ], "TextCampaignFieldNames": [ "CounterIds", "RelevantKeywords", "Settings", "BiddingStrategy" ] } }' \ "https://api-sandbox.direct.yandex.com/json/v5/campaigns"
Switching to using real user data
-
In your application, implement a way to get a token that is convenient for your users.
-
Switch the request for test access to full access. Wait for your request to be approved.
-
In your application, replace the sandbox addresses with the real addresses. The address for each service is provided in the service description.