G
G
Godwp2014-08-23 08:53:09
PHP
Godwp, 2014-08-23 08:53:09

YandexMarkertAPI: Where can I get data for the API?

I'm trying to connect a store to Ya.Market using the Yandex Market for Partner
library . I'm trying to do:

use Yandex\Market\MarketClient;
//
$market = new MarketClient(ACCESS_TOKEN);
$market->setClientId(CLIENT_ID);
//логин, указанный при регистрации в партнерском интерфейсе
$market->setLogin(MARKET_LOGIN);
$campaigns = $market->getCampaigns();
/** @var \Yandex\Market\Campaign $campaign */
foreach($campaigns as $campaign){
    print_r($campaign->toArray());
}

I am getting an error:
Fatal error: Uncaught exception 'Yandex\Common\Exception\ForbiddenException' with message 'Forbidden' in phar:///home/yandex-sdk_master.phar/src/Yandex/Market/MarketClient.php:200

I think I entered this data incorrectly:
ACCESS_TOKEN
CLIENT_ID
MARKET_LOGIN
ACCESS_TOKEN - received in Settings -> Purchase API Settings -> Authorization...
CLIENT_ID - in oauth.yandex.ru . I registered the application, Yandex.Market -> Yandex.Market API for partners
indicated its rights MARKET_LOGIN - your login on Yandex, as it is indicated here https://partner.market.yandex.ru/manage.xml . View %login% @yandex .ru
In the purchase API settings
Authorization type - HEADER
Data format - JSON
Please tell me what I'm doing wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Godwp, 2014-08-24
@Godwp

I connected the old version of the library without the ability to work with the i.market.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question