Mottor API
Search…
⌃K

Работа с заявками

Работа с заявками. Получить, создать или удалить заявку. Как обновить статус заявки — всё это можно узнать на нашем сайте

Работа с заявками из корзины

get
https://api.lpmotor.ru
/v1/lead
Список заявок

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

CURL
PHP CURL
PHP Guzzle
Javascript
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/lead?d_create_start=2020-08-09+00:00:00%2B05:00&sort_field[]=dCreated&sort_dir[]=ASC&status_id[]=1&limit=18&offset=0"
<?php
$ch = curl_init();
$url = 'https://api.lpmotor.ru/v1/lead';
$params = [
'd_create_start' => '2021-02-16T09:25:43+00:00',
'd_create_end' => '2021-03-16T09:25:43+00:00',
'status_id' => [1],
'type_id' => [1],
];
$url .= '?' . http_build_query($params);
curl_setopt($ch, CURLOPT_URL, $url);
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);
$responseData = json_decode($result, true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.lpmotor.ru',
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Api-User-Id' => $userId,
'Authorization' => 'Bearer ' . $apiKey,
],
]);
$response = $client->get(
'/v1/lead',
[
'query' => [
'd_create_start' => '2021-02-16T09:25:43+00:00',
'd_create_end' => '2021-03-16T09:25:43+00:00',
'status_id' => [1],
'type_id' => [1],
]
]
);
$statusCode = $response->getStatusCode();
$responseData = json_decode((string)$response->getBody(), true);
http = Axios.create({
baseURL: "https://api.lpmotor.ru",
timeout: 30000,
headers: {
"Content-Type" : "application/json",
"Accept" : "application/json",
"Cache-Control": "no-cache, no-store, must-revalidate",
"X-Api-User-Id": userId,
"Authorization": "Bearer " + myApiKey,
}
});
http.get("/v1/lead", {
params: data
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
get
https://api.lpmotor.ru
/v1/lead/{lead_id}
Получить заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
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/lead/<<lead_id>>"
<?php
$ch = curl_init();
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
curl_setopt($ch, CURLOPT_URL, $url);
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);
$responseData = json_decode($result, true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.lpmotor.ru',
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Api-User-Id' => $userId,
'Authorization' => 'Bearer ' . $apiKey,
],
]);
$response = $client->get('/v1/lead/' . $leadId);
$statusCode = $response->getStatusCode();
$responseData = json_decode((string)$response->getBody(), true);
http = Axios.create({
baseURL: "https://api.lpmotor.ru",
timeout: 30000,
headers: {
"Content-Type" : "application/json",
"Accept" : "application/json",
"Cache-Control": "no-cache, no-store, must-revalidate",
"X-Api-User-Id": userId,
"Authorization": "Bearer " + myApiKey,
}
});
http.get("/v1/lead/" + leadId)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
post
https://api.lpmotor.ru
/v1/lead
Создать заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
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 POST "https://api.lpmotor.ru/v1/lead" \
-d "{page_id: <<page_id>>, status_id: <<status_id>>, type_id: <<type_id>>}"
<?php
$ch = curl_init();
$url = 'https://api.lpmotor.ru/v1/lead';
$data = [
'page_id' => $pageId,
'status_id' => $statusId,
'type_id' => $typeId,
];
curl_setopt($ch, CURLOPT_URL, $url);
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_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
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);
$responseData = json_decode($result, true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.lpmotor.ru',
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Api-User-Id' => $userId,
'Authorization' => 'Bearer ' . $apiKey,
],
]);
$data = [
'page_id' => $pageId,
'status_id' => $statusId,
'type_id' => $type_id,
];
$response = $client->post(
'/v1/lead',
[
'json' => $data,
]
);
$statusCode = $response->getStatusCode();
$responseData = json_decode((string)$response->getBody(), true);
http = Axios.create({
baseURL: "https://api.lpmotor.ru",
timeout: 30000,
headers: {
"Content-Type" : "application/json",
"Accept" : "application/json",
"Cache-Control": "no-cache, no-store, must-revalidate",
"X-Api-User-Id": userId,
"Authorization": "Bearer " + myApiKey,
}
});
http.post("/v1/lead", {
page_id : pageId,
status_id: statusId,
type_id : typeId
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
patch
https://api.lpmotor.ru
/v1/lead/{lead_id}
Обновить статус заявки

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

CURL
PHP CURL
PHP Guzzle
Javascript
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 PATCH "https://api.lpmotor.ru/v1/lead/<<lead_id>>" \
-d "{status_id: <<status_id>>}"
<?php
$ch = curl_init();
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
$data = ['status_id' => $statusId];
curl_setopt($ch, CURLOPT_URL, $url);
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_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
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);
$responseData = json_decode($result, true);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.lpmotor.ru',
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Api-User-Id' => $userId,
'Authorization' => 'Bearer ' . $apiKey,
],
]);
$data = ['status_id' => $statusId];
$response = $client->patch(
'/v1/lead/' . $leadId,
[
'json' => $data,
]
);
$statusCode = $response->getStatusCode();
$responseData = json_decode((string)$response->getBody(), true);
http = Axios.create({
baseURL: "https://api.lpmotor.ru",
timeout: 30000,
headers: {
"Content-Type" : "application/json",
"Accept" : "application/json",
"Cache-Control": "no-cache, no-store, must-revalidate",
"X-Api-User-Id": userId,
"Authorization": "Bearer " + myApiKey,
}
});
http.patch("/v1/lead/" + leadId, {status_id: statusId})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
delete
https://api.lpmotor.ru
/v1/lead/{lead_id}
Удалить заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
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 DELETE "https://api.lpmotor.ru/v1/lead/<<lead_id>>"
<?php
$ch = curl_init();
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
curl_setopt($ch, CURLOPT_URL, $url);
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_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
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);
curl_close($ch);
<?php
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.lpmotor.ru',
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Api-User-Id' => $userId,
'Authorization' => 'Bearer ' . $apiKey,
],
]);
$response = $client->delete('/v1/lead/' . $leadId);
$statusCode = $response->getStatusCode();
http = Axios.create({
baseURL: "https://api.lpmotor.ru",
timeout: 30000,
headers: {
"Content-Type" : "application/json",
"Accept" : "application/json",
"Cache-Control": "no-cache, no-store, must-revalidate",
"X-Api-User-Id": userId,
"Authorization": "Bearer " + myApiKey,
}
});
http.delete("/v1/lead/" + leadId)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});