- Подготовка производственной площадки к маркировке
- Сроки внедрения маркировки для производителей: что нужно знать малым, средним и крупным?
- Оборудование для маркировки: какое нужно и что пригодится из того, что у вас уже есть?
- Состав кода маркировки молочной продукции
Необходимо авторизоваться или зарегистрироваться на портале
Проверка принадлежности карточек к маркируемым товарным группам
Здравствуйте
В описании апи национального каталога есть метод mark-check. Но почему-то я получаю пустой ответ.
Вот код php:
$url = $apihost.'/v3/mark-check?apikey='.$apikey;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$fp = fopen(dirname(__FILE__).'/errorlog.txt', 'w');
curl_setopt($ch, CURLOPT_STDERR, $fp);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{«gtins»:[«02900618378929»,«02900618378899»,«02900618378868»]}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json;charset=utf-8']);
$req = curl_exec($ch);
print_r($req);
curl_close($ch);
В файле errorlog.txt выдается:
* Trying 91.230.251.79:443...
* Connected to xn--80aqu.xn----7sbabas4ajkhfocclk9d3cvfsa.xn--p1ai (91.230.251.79) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
* subject: CN=*.xn----7sbabas4ajkhfocclk9d3cvfsa.xn--p1ai
* start date: Oct 16 16:18:47 2023 GMT
* expire date: Nov 16 16:18:46 2024 GMT
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign GCC R3 DV TLS CA 2020
* SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: POST]
* h2h3 [:path: /v3/mark-check?apikey=myapikey]
* h2h3 [:scheme: https]
* h2h3 [:authority: xn--80aqu.xn----7sbabas4ajkhfocclk9d3cvfsa.xn--p1ai]
* h2h3 [accept: */*]
* h2h3 [content-type: application/json;charset=utf-8]
* h2h3 [content-length: 46]
* Using Stream ID: 1 (easy handle 0x15a20a0)
> POST /v3/mark-check?apikey=myapikey HTTP/2
Host: xn--80aqu.xn----7sbabas4ajkhfocclk9d3cvfsa.xn--p1ai
accept: */*
content-type: application/json;charset=utf-8
content-length: 46
* We are completely uploaded and fine
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 403
< server: nginx
< date: Thu, 29 Aug 2024 07:25:54 GMT
< content-length: 0
< cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
<
* Connection #0 to host xn--80aqu.xn----7sbabas4ajkhfocclk9d3cvfsa.xn--p1ai left intact
Что не так делаю?