curl --request POST \
--url https://logistics.api.smartcp.org/v1/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Client-Directory: <api-key>' \
--data '
{
"surname": "Kowalski",
"name": "Jan"
}
'const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Client-Directory': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({surname: 'Kowalski', name: 'Jan'})
};
fetch('https://logistics.api.smartcp.org/v1/drivers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://logistics.api.smartcp.org/v1/drivers"
payload = {
"surname": "Kowalski",
"name": "Jan"
}
headers = {
"Authorization": "Bearer <token>",
"X-Client-Directory": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://logistics.api.smartcp.org/v1/drivers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'surname' => 'Kowalski',
'name' => 'Jan'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Client-Directory: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": 201,
"message": "Created",
"data": {
"id": 125,
"surname": "KOWALSKI",
"name": "JAN"
}
}{
"status": 401,
"message": "Authentication failed",
"data": null
}{
"status": 422,
"message": "The surname field is required.",
"data": null
}{
"status": 429,
"message": "Too Many Attempts.",
"data": null
}{
"status": 500,
"message": "Internal Server Error",
"data": null
}Add
Adds a driver to SmartCP Logistics. Only surname and name are required; all other supported driver details can be supplied when available.
curl --request POST \
--url https://logistics.api.smartcp.org/v1/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Client-Directory: <api-key>' \
--data '
{
"surname": "Kowalski",
"name": "Jan"
}
'const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Client-Directory': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({surname: 'Kowalski', name: 'Jan'})
};
fetch('https://logistics.api.smartcp.org/v1/drivers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://logistics.api.smartcp.org/v1/drivers"
payload = {
"surname": "Kowalski",
"name": "Jan"
}
headers = {
"Authorization": "Bearer <token>",
"X-Client-Directory": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://logistics.api.smartcp.org/v1/drivers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'surname' => 'Kowalski',
'name' => 'Jan'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Client-Directory: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": 201,
"message": "Created",
"data": {
"id": 125,
"surname": "KOWALSKI",
"name": "JAN"
}
}{
"status": 401,
"message": "Authentication failed",
"data": null
}{
"status": 422,
"message": "The surname field is required.",
"data": null
}{
"status": 429,
"message": "Too Many Attempts.",
"data": null
}{
"status": 500,
"message": "Internal Server Error",
"data": null
}Authorizations
Client API key sent as a bearer token.
Client directory identifier. Legacy directory header is still accepted for backward compatibility.
Body
Driver surname.
64"Kowalski"
Driver first name.
64"Jan"
Driver phone number.
32"+48 123 456 789"
Identification document number.
64"ABC123456"
Employment type or description.
32"Employment contract"
Country codes in which the driver is permitted to operate.
8["de", "fr"]
Driving licence category.
16"C+E"
Driving licence number.
16"12345/26"
Driver card identifier.
32"PL1234567890"
Marks the driver as a trainee.
Indicates that the driver has ADR qualifications.
Indicates that the driver has AVSEC qualifications.
Indicates that the driver has GDP qualifications.
Indicates that the driver has TAPA qualifications.