For the complete documentation index, see llms.txt. This page is also available as Markdown.

Экспорт

Метод API, который позволяет выгрузить товары из конструктора в формате CSV или в формате YML(Yandex Markup Language)

Экспорт товаров

GET https://api.lpmotor.ru/v1/shop/product/site/{site_id}.{file_type}

Path Parameters

Name
Type
Description

site_id*

integer

ID сайта

file_type*

string

Тип файла для выгрузки. Поддерживаемые значения: csv, yml

Headers

Name
Type
Description

Authorization*

string

API токен

X-Api-User-Id*

string

ID пользователя

{
    "data": "base64_encoded_string"
}
{
    "title": "user can`t assess to edit this site",
    "error": 8,
    "code": 403
}

Пример запроса

curl \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Api-User-Id: <<Your-user-id>>" \
-H "Authorization: Bearer <<Your-API-token>>" \
-X GET "https://api.lpmotor.ru/v1/shop/product/site/11111.csv" 
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.lpmotor.ru/v1/shop/product/site/' . $siteId . '.csv');
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    [
        'Host: api.lpmotor.ru',
        'X-Api-User-Id: ' . $userId,
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json',
        'Accept: application/json',
    ]
);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

$result = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$siteList = json_decode($result, true);

curl_close($ch);

Пример запроса

Последнее обновление