Answer the question
In order to leave comments, you need to log in
How to get a Yandex token?
<?php
$yandex_get_token_url = "https://oauth.yandex.ru/token";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $yandex_get_token_url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=password&username=ЛОГИН_УЧЕТНОЙ_
ЗАПИСИ_ЯНДЕКСА&password=ПАРОЛЬ_ОТ_УЧЕТНОЙ_
ЗАПИСИ_ЯНДЕКСА&client_id=ID_ПРИЛОЖЕНИЯ&client_secret=ПАРОЛЬ_ПРИЛОЖЕНИЯ');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$token = curl_exec($ch);
curl_close($ch);
echo $token;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question