Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

неудается получить токен #198

Open
zhmenya opened this issue Jun 17, 2023 · 1 comment
Open

неудается получить токен #198

zhmenya opened this issue Jun 17, 2023 · 1 comment
Labels

Comments

@zhmenya
Copy link

zhmenya commented Jun 17, 2023

$process = curl_init("https://b2bapi.onliner.by/oauth/token");
curl_setopt($process, CURLOPT_HTTPHEADER, array('Accept: application/json','Content-Type: application/x-www-form-urlencoded'));
curl_setopt($process, CURLOPT_USERPWD, "ClientID:SecretKey");
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($process, CURLOPT_POSTFIELDS, array('grant_type' => 'client_credentials'));
$result = curl_exec($process);
curl_close($process);

возвращает пустую строку, через PostMan у менеджера onliner удалось получить токен

@zhmenya zhmenya changed the title на сайте elmarket.by неудается получить токен неудается получить токен Jun 17, 2023
@mohorev
Copy link
Member

mohorev commented Jun 19, 2023

Попробуйте повторить запрос с этим кодом, только не передавайте Content-Type в заголовке.

Пример:

curl_setopt($process, CURLOPT_HTTPHEADER, array('Accept: application/json'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants