I
I
Ivan Ivanov2018-04-27 13:10:08
PHP
Ivan Ivanov, 2018-04-27 13:10:08

How to connect Yandex.Market reviews on the site?

The Yandex API says that you need to get the authorization key and then insert it into the executable script. I got the script from there.

<?$url = "https://api.content.market.yandex.ru/v1/shop/{302413}/opinion.json";
            $headers = array(
                "Host: api.content.market.yandex.ru",
                "Accept: */*",
                "Authorization: {Ключ авторизации}" // ключ подставлю верно, проверил несколько раз
            );
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            $data = curl_exec($ch);
            curl_close($ch);?>

but for some reason it doesn't work =( It says {"errors":["Authorization failed: request from unknown IP address 2a03:6f00:1::5c35:72c9 or invalid key or key suspended or key missing"]}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Ivanov, 2018-04-27
@ZZiliST

I figured it out... you just need not to write { } these brackets when inserting the key and store ID.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question