Introduction
This documentation aims to provide all the information you need to work with our API.
Base URL
https://wiringdiagrams.api.diesellaptops.com
Authenticating requests
To authenticate requests, include a DL-Authorization
header with the value "{YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You get API token in the response after Authorization on https://api.users.diesellaptops.com.
Documents
List
Retrieve all diagrams.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram?search=necessitatibus&sort_by=name&sort_dir=desc&page=2&per_page=8" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram"
);
let params = {
"search": "necessitatibus",
"sort_by": "name",
"sort_dir": "desc",
"page": "2",
"per_page": "8",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Retrieve
Retrieve the diagram.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/18" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/18"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Create
Create new diagram.
Example request:
curl -X POST \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-F "name=Allison-WTECIII-TransID1.pdf" \
-F "preview_pages=1-3,4" \
-F "type_ids[]=[1,3,15]" \
-F "pdf=@/tmp/phpdwz1Bw"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
const body = new FormData();
body.append('name', 'Allison-WTECIII-TransID1.pdf');
body.append('preview_pages', '1-3,4');
body.append('type_ids[]', '[1,3,15]');
body.append('pdf', document.querySelector('input[name="pdf"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Update
Update the diagram.
Example request:
curl -X PUT \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/19" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-F "name=Allison-WTECIII-TransID1.pdf" \
-F "preview_pages=1-3,4" \
-F "type_ids[]=[1,3,15]" \
-F "pdf=@/tmp/phppBrkty"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/19"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
const body = new FormData();
body.append('name', 'Allison-WTECIII-TransID1.pdf');
body.append('preview_pages', '1-3,4');
body.append('type_ids[]', '[1,3,15]');
body.append('pdf', document.querySelector('input[name="pdf"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Partial Update
Update one or more fields of the diagram instance.
Example request:
curl -X PATCH \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/5" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-F "name=Allison-WTECIII-TransID1.pdf" \
-F "preview_pages=1-3,4" \
-F "type_ids[]=[1,3,15]" \
-F "pdf=@/tmp/phphBcz5v"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/5"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
const body = new FormData();
body.append('name', 'Allison-WTECIII-TransID1.pdf');
body.append('preview_pages', '1-3,4');
body.append('type_ids[]', '[1,3,15]');
body.append('pdf', document.querySelector('input[name="pdf"]').files[0]);
fetch(url, {
method: "PATCH",
headers,
body,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name may not be greater than 255 characters."
]
}
}
Received response:
Request failed with error:
Delete
Delete the diagram.
Example request:
curl -X DELETE \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/11" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/11"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
[]
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Attach
Attach new PDF file to the diagram.
Example request:
curl -X POST \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/totam/attach" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-F "preview_pages=1-3,4" \
-F "pdf=@/tmp/php50gxSv"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/totam/attach"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
const body = new FormData();
body.append('preview_pages', '1-3,4');
body.append('pdf', document.querySelector('input[name="pdf"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name may not be greater than 255 characters."
]
}
}
Received response:
Request failed with error:
Import
Import documents from .zip archive.
Archive must have a file data.csv
and a folder files
. data.csv
must have the following columns:
Filename,Industry,Make,Model,Year Range,Module,Document Type
.
The folder files
must contain all PDF files specified in the column Filename
of the data.csv
.
Example request:
curl -X POST \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/import" \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-F "notify=dolorem" \
-F "data=@/tmp/phpqaAm5v"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/import"
);
let headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
const body = new FormData();
body.append('notify', 'dolorem');
body.append('data', document.querySelector('input[name="data"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
Example response (200):
{
"data": "The import has been scheduled. A notification will be sent to john.doe@example.com when it is completed."
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"import-data": [
"The notify field is required."
]
}
}
Received response:
Request failed with error:
Export
Export diagram data.
Example request:
curl -X POST \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/export" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"notify":"aut"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram/export"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"notify": "aut"
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": "The import has been scheduled. A notification will be sent to john.doe@example.com when it is completed."
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"import-data": [
"The notify field is required."
]
}
}
Received response:
Request failed with error:
View
Retrieve the diagram PDF file.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/consequuntur/diagram" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/consequuntur/diagram"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
PDF file
Received response:
Request failed with error:
Preview
Retrieve the preview file of the diagram.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/ut/preview" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram/ut/preview"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
PDF file
Received response:
Request failed with error:
Reports
Download the report
Download the generated report.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/report/NG94HExPwxSwuP84O1pmIeNhZzlhRKvR" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/report/NG94HExPwxSwuP84O1pmIeNhZzlhRKvR"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
file
Received response:
Request failed with error:
Statistics
Active Users
Retrieve statistics on active users.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/stat/active-users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"from":"laudantium","to":"quos"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/stat/active-users"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"from": "laudantium",
"to": "quos"
}
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"qty": 12345,
"month": "2021-01"
}
]
}
Received response:
Request failed with error:
Downloads
Retrieve statistics on downloads.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/stat/downloads" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"from":"fugiat","to":"dolores"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/stat/downloads"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"from": "fugiat",
"to": "dolores"
}
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"qty": 12345,
"month": "2021-01"
}
]
}
Received response:
Request failed with error:
Top Users
Retrieve statistics on most active users.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/stat/top-users" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"max":9,"from":"hic","to":"consectetur"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/stat/top-users"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"max": 9,
"from": "hic",
"to": "consectetur"
}
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"qty": 123,
"user_id": 1
}
]
}
Received response:
Request failed with error:
Top Diagrams
Retrieve statistics on the most viewed diagrams.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/stat/top-diagrams" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"max":10,"from":"mollitia","to":"itaque"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/stat/top-diagrams"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"max": 10,
"from": "mollitia",
"to": "itaque"
}
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 4,
"name": "2.PDF",
"token": "a86519d593f75dff075dea4b257649c9",
"preview_pages": "1",
"url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbiI6ImE4NjUxOWQ1OTNmNzVkZmYwNzVkZWE0YjI1NzY0OWM5IiwidXNlcl9pZCI6MjkyNCwic3Vic2NyaWJlZCI6dHJ1ZSwiaWF0IjoxNjM3MTUyMzk3fQ.HquAP5dlBXq072cD3iVzJ8q-I-0Q8jaIKuz_3djTU_c\/diagram",
"preview_url": "https:\/\/wiringdiagrams.api.diesellaptops.com\/api\/v1\/diagram\/a86519d593f75dff075dea4b257649c9\/preview?cache-buster=1637152395",
"type_ids": [
1
],
"size": "225.3Kb",
"types": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": 4
}
],
"qty": 1234
}
]
}
Received response:
Request failed with error:
Requests
Retrieve statistics on requests.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/stat/requests" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"from":"hic","to":"nostrum","per":"month"}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/stat/requests"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"from": "hic",
"to": "nostrum",
"per": "month"
}
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"qty": 12345,
"period": "2021-01"
}
]
}
Received response:
Request failed with error:
Types
List
Retrieve all types.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram_type" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram_type"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": null
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Retrieve
Retrieve the type.
Example request:
curl -X GET \
-G "https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram_type/8" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/v1/diagram_type/8"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Create
Create new type.
Example request:
curl -X POST \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"year_id":4,"module_id":18,"name":"Motor Control Module 2.1","diagram_id":5}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"year_id": 4,
"module_id": 18,
"name": "Motor Control Module 2.1",
"diagram_id": 5
}
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Update
Update the type.
Example request:
curl -X PUT \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/4" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"year_id":2,"module_id":14,"name":"Motor Control Module 2.1","diagram_id":19}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/4"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"year_id": 2,
"module_id": 14,
"name": "Motor Control Module 2.1",
"diagram_id": 19
}
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Partial Update
Update one or more fields of the type instance.
Example request:
curl -X PATCH \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/15" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}" \
-d '{"year_id":4,"module_id":5,"name":"Motor Control Module 2.1","diagram_id":2}'
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/15"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
let body = {
"year_id": 4,
"module_id": 5,
"name": "Motor Control Module 2.1",
"diagram_id": 2
}
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 1,
"year_id": 162,
"module_id": null,
"name": "Aliquam fermentum tincidunt",
"diagram_id": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name may not be greater than 255 characters."
]
}
}
Received response:
Request failed with error:
Delete
Delete the type.
Example request:
curl -X DELETE \
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/18" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "DL-Authorization: {YOUR-API-KEY}"
const url = new URL(
"https://wiringdiagrams.api.diesellaptops.com/api/diagram_type/18"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"DL-Authorization": "{YOUR-API-KEY}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
[]
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error: