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

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

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-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"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/lead';
4
$params = [
5
'd_create_start' => '2021-02-16T09:25:43+00:00',
6
'd_create_end' => '2021-03-16T09:25:43+00:00',
7
'status_id' => [1],
8
'type_id' => [1],
9
];
10
$url .= '?' . http_build_query($params);
11
12
curl_setopt($ch, CURLOPT_URL, $url);
13
curl_setopt(
14
$ch,
15
CURLOPT_HTTPHEADER,
16
[
17
'Host: api.lpmotor.ru',
18
'X-Api-User-Id: ' . $userId,
19
'Authorization: Bearer ' . $apiKey,
20
'Content-Type: application/json',
21
'Accept: application/json',
22
]
23
);
24
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
25
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
26
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
27
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
28
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
29
30
$result = curl_exec($ch);
31
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
32
$responseData = json_decode($result, true);
33
34
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get(
12
'/v1/lead',
13
[
14
'query' => [
15
'd_create_start' => '2021-02-16T09:25:43+00:00',
16
'd_create_end' => '2021-03-16T09:25:43+00:00',
17
'status_id' => [1],
18
'type_id' => [1],
19
]
20
]
21
);
22
$statusCode = $response->getStatusCode();
23
$responseData = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/lead", {
13
params: data
14
})
15
.then(function (response) {
16
console.log(response);
17
})
18
.catch(function (error) {
19
console.log(error);
20
});
Copied!
get
https://api.lpmotor.ru
/v1/lead/{lead_id}
Получить заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X GET "https://api.lpmotor.ru/v1/lead/<<lead_id>>"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
4
5
curl_setopt($ch, CURLOPT_URL, $url);
6
curl_setopt(
7
$ch,
8
CURLOPT_HTTPHEADER,
9
[
10
'Host: api.lpmotor.ru',
11
'X-Api-User-Id: ' . $userId,
12
'Authorization: Bearer ' . $apiKey,
13
'Content-Type: application/json',
14
'Accept: application/json',
15
]
16
);
17
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
18
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
19
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
20
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
21
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
22
23
$result = curl_exec($ch);
24
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
25
$responseData = json_decode($result, true);
26
27
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get('/v1/lead/' . $leadId);
12
$statusCode = $response->getStatusCode();
13
$responseData = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/lead/" + leadId)
13
.then(function (response) {
14
console.log(response);
15
})
16
.catch(function (error) {
17
console.log(error);
18
});
Copied!
post
https://api.lpmotor.ru
/v1/lead
Создать заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X POST "https://api.lpmotor.ru/v1/lead" \
7
-d "{page_id: <<page_id>>, status_id: <<status_id>>, type_id: <<type_id>>}"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/lead';
4
$data = [
5
'page_id' => $pageId,
6
'status_id' => $statusId,
7
'type_id' => $typeId,
8
];
9
10
curl_setopt($ch, CURLOPT_URL, $url);
11
curl_setopt(
12
$ch,
13
CURLOPT_HTTPHEADER,
14
[
15
'Host: api.lpmotor.ru',
16
'X-Api-User-Id: ' . $userId,
17
'Authorization: Bearer ' . $apiKey,
18
'Content-Type: application/json',
19
'Accept: application/json',
20
]
21
);
22
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
23
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
24
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
25
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
26
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
27
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
28
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
29
30
$result = curl_exec($ch);
31
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
32
$responseData = json_decode($result, true);
33
34
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$data = [
12
'page_id' => $pageId,
13
'status_id' => $statusId,
14
'type_id' => $type_id,
15
];
16
$response = $client->post(
17
'/v1/lead',
18
[
19
'json' => $data,
20
]
21
);
22
$statusCode = $response->getStatusCode();
23
$responseData = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.post("/v1/lead", {
13
page_id : pageId,
14
status_id: statusId,
15
type_id : typeId
16
})
17
.then(function (response) {
18
console.log(response);
19
})
20
.catch(function (error) {
21
console.log(error);
22
});
Copied!
patch
https://api.lpmotor.ru
/v1/lead/{lead_id}
Обновить статус заявки

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

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X PATCH "https://api.lpmotor.ru/v1/lead/<<lead_id>>" \
7
-d "{status_id: <<status_id>>}"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
4
$data = ['status_id' => $statusId];
5
6
curl_setopt($ch, CURLOPT_URL, $url);
7
curl_setopt(
8
$ch,
9
CURLOPT_HTTPHEADER,
10
[
11
'Host: api.lpmotor.ru',
12
'X-Api-User-Id: ' . $userId,
13
'Authorization: Bearer ' . $apiKey,
14
'Content-Type: application/json',
15
'Accept: application/json',
16
]
17
);
18
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
19
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
20
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
21
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
22
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
23
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
24
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
25
26
$result = curl_exec($ch);
27
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
28
$responseData = json_decode($result, true);
29
30
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$data = ['status_id' => $statusId];
12
$response = $client->patch(
13
'/v1/lead/' . $leadId,
14
[
15
'json' => $data,
16
]
17
);
18
$statusCode = $response->getStatusCode();
19
$responseData = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.patch("/v1/lead/" + leadId, {status_id: statusId})
13
.then(function (response) {
14
console.log(response);
15
})
16
.catch(function (error) {
17
console.log(error);
18
});
Copied!
delete
https://api.lpmotor.ru
/v1/lead/{lead_id}
Удалить заявку

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

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X DELETE "https://api.lpmotor.ru/v1/lead/<<lead_id>>"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/lead/' . $leadId;
4
5
curl_setopt($ch, CURLOPT_URL, $url);
6
curl_setopt(
7
$ch,
8
CURLOPT_HTTPHEADER,
9
[
10
'Host: api.lpmotor.ru',
11
'X-Api-User-Id: ' . $userId,
12
'Authorization: Bearer ' . $apiKey,
13
'Content-Type: application/json',
14
'Accept: application/json',
15
]
16
);
17
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
18
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
19
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
20
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
21
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
22
23
$result = curl_exec($ch);
24
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
25
26
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->delete('/v1/lead/' . $leadId);
12
$statusCode = $response->getStatusCode();
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.delete("/v1/lead/" + leadId)
13
.then(function (response) {
14
console.log(response);
15
})
16
.catch(function (error) {
17
console.log(error);
18
});
Copied!
Last modified 3mo ago