Introduction
This documentation aims to provide all the information you need to work with our API.
Base URL
https://api-cc.com
Authenticating requests
This API is authenticated by sending 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.
Access
Access
requires authentication
Get information if the user has access to the search and number of free searches. If number of free searches is unlimited -1 is returned.
Example request:
const url = new URL(
"https://api-cc.com/api/v1/access"
);
let headers = {
"DL-Authorization": "{YOUR-API-KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"access": true,
"free_searches": 1
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Category
List
requires authentication
Retrieve all categories with subcategories
Example request:
const url = new URL(
"https://api-cc.com/api/v1/category"
);
let params = {
"sort_by": "name",
"sort_dir": "desc",
"page": "14",
"per_page": "13",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"DL-Authorization": "{YOUR-API-KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 1,
"parent_id": null,
"name": "Truck Repair",
"special_fields": false,
"has_manufacturers": false,
"children": [
{
"id": 2,
"parent_id": 1,
"name": "Dealership",
"special_fields": false,
"has_manufacturers": false,
"children": []
}
]
}
],
"links": {
"first": "https:\/\/api-cc.com\/api\/v1\/category?page=1",
"last": "https:\/\/api-cc.com\/api\/v1\/category?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https:\/\/api-cc.com\/api\/v1\/category",
"per_page": 10,
"to": 3,
"total": 3
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Company
List
requires authentication
Retrieve all companies. You should be subscribed to the Customer Connect Service otherwise you're limited by 2 requests per month.
Example request:
const url = new URL(
"https://api-cc.com/api/v1/company"
);
let params = {
"zip": "12345",
"radius": "102733873.3621",
"trucks_owned_from": "3",
"trucks_owned_to": "8",
"category_id": "19",
"manufacturer_id": "18",
"state": "sit",
"sort_by": "name",
"sort_dir": "desc",
"page": "4",
"per_page": "12",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"DL-Authorization": "{YOUR-API-KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 14,
"category_id": 4,
"manufacturer_id": 1,
"hierarchy": [
{
"id": 1,
"name": "Truck Repair"
},
{
"id": 4,
"name": "Independent Garage"
}
],
"name": "West Memphis Diesel & Truck Repair",
"address_line_1": "604 Balfour Rd",
"address_line_2": "",
"city": "West Memphis",
"state": "AR",
"zip": "72301",
"address": "604 Balfour Rd, West Memphis, AR 72301, USA",
"phone": "+1 901-652-2545",
"website": "http:\/\/www.westmemphistrucktrailerrepair.com",
"contact_name": "John Doe",
"contact_title": "Mr.",
"lat": 35.163535,
"lng": -90.1975975,
"us_dot": null,
"trucks_owned": null,
"drivers": null
}
],
"links": {
"first": "https:\/\/api-cc.com\/api\/v1\/company?page=1",
"last": "https:\/\/api-cc.com\/api\/v1\/company?page=3",
"prev": null,
"next": "https:\/\/api-cc.com\/api\/v1\/company?page=2"
},
"meta": {
"current_page": 1,
"free_searches": -1,
"from": 1,
"last_page": 3,
"path": "https:\/\/api-cc.com\/api\/v1\/company",
"per_page": 10,
"to": 10,
"total": 25
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Report Issue
requires authentication
Report bad data about the company.
Example request:
const url = new URL(
"https://api-cc.com/api/v1/company/1/report-issue"
);
let params = {
"issue": "ex",
"user_name": "neque",
"user_email": "aut",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"DL-Authorization": "{YOUR-API-KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Example response (200):
{
"message": "You issue report is submitted."
}
Received response:
Request failed with error:
Manufacturer
List
requires authentication
Retrieve all manufacturers.
Example request:
const url = new URL(
"https://api-cc.com/api/v1/manufacturer"
);
let params = {
"sort_by": "name",
"sort_dir": "desc",
"page": "1",
"per_page": "6",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"DL-Authorization": "{YOUR-API-KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 3,
"name": "Caterpillar"
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error: