Клуб API Вебмастера

WEBMASTER API ERROR ' Need rights for "webmaster:verify" '

naveen4spraveen
21 февраля 2013, 13:56

Hi

I am using the web master api and i have successfully logged in and got the access token

After getting the access token i tried to get the uid by using the/api/me (Getting The UserId)

unexpectedly i am getting the error message as ' Need rights for "webmaster:verify" '


The following is the function i am using to get the uid in PHP


 function get_yandex_data($url){

        echo $url;        

        $curl = curl_init($url);

        curl_setopt($curl, CURLOPT_HEADER, 1);

        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

        curl_setopt($curl, CURLOPT_HTTPHEADER,array("Authorization: OAuth $this->access_token")

        //curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $this->access_key )

        $json_response = curl_exec($curl);

        echo "<pre>";

        print_r($json_response);

        curl_close($curl);

        $response = json_decode($json_response, true);

        return $response;

    }


The following is the response i am getting from the API


Access Token =c09e69e3f86442cb9d6154245e46dd8f
https://webmaster.yandex.ru/api/me

HTTP/1.1 403 Forbidden
Content-Type: text/html; charset=windows-1251
Expires: Thu, 21 Feb 2013 09:10:51 GMT
Set-Cookie: yandexuid=4097835271361437551; domain=.yandex.ru; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT
Transfer-Encoding: chunked
Date: Thu, 21 Feb 2013 09:05:51 GMT
Server: lighttpd/1.4.26

Need rights for "webmaster:verify"
Can somebody guide me what the erro mean to be and how could it be rectified.
Thank You
1 комментарий
Подписаться на комментарии к посту

Hello!
Your access token doesn't have permissions to work with Yandex.Webmaster API. You should add the application's permissions on that page https://oauth.yandex.ru/client/my 

Unfortunately English-translated page doesn't contain Yandex.Webmaster API in the list of application's rights, so it's possible to add rights only on https://oauth.yandex.ru/client/my.  We are sorry for inconvenience.

If you have any questions, feel free to ask.