NAV -image
bash javascript

Introduction

This documentation aims to provide all the information you need to work with our API.

Base URL

https://api-sbt.com

Authenticating requests

Authenticate requests to this API's endpoints by sending a X-Authorization header with the value "your-token". All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Document

List

requires authentication

Retrieve all documents. If the parameter 'symptom_id' is specified all documents for it are retrieved and all other query parameters don't work. If 'symptom_id' is missed the result is paginated.

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/document?symptom_id=3&sort_by=name&sort_dir=desc&page=20&per_page=20" \
    -H "X-Authorization: vZ1k56EP6ehdac83abfgVD4" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"symptom_id":9}'
const url = new URL(
    "https://api-sbt.com/api/v1/document"
);

let params = {
    "symptom_id": "3",
    "sort_by": "name",
    "sort_dir": "desc",
    "page": "20",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "vZ1k56EP6ehdac83abfgVD4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "symptom_id": 9
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 1,
            "symptom_id": 1,
            "name": "Lorem ipsum dolor sit amet",
            "notes": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla congue imperdiet erat, id sollicitudin mi laoreet at. Aliquam ac augue placerat, pharetra justo quis, iaculis nisl. Quisque neque lorem, rutrum id nisi et, interdum scelerisque justo. Morbi sit amet congue urna.<\/p>",
            "videoUrl": "https:\/\/www.youtube.com\/watch?v=72372392293",
            "fileUrl": "https:\/\/api-sbt.com\/storage\/public\/files\/TyKJwXPn8akJzMfW9rr0QwwBQFB2jXOkZ1jDXWuq.pdf",
            "order": 1
        },
        {
            "id": 2,
            "symptom_id": 1,
            "name": "Nulla volutpat libero eget est aliquet",
            "notes": "<p>Nulla volutpat libero eget est aliquet, in cursus urna vulputate. Sed non convallis sapien.<\/p>",
            "videoUrl": "https:\/\/www.youtube.com\/watch?v=42342342555",
            "fileUrl": "",
            "order": 2
        }
    ],
    "meta": {
        "pdfUrl": "https:\/\/api-sbt.com\/api\/v1\/view\/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzeW1wdG9tX2lkIjoiNDEiLCJpYXQiOjE2MTIxNzE5ODgsImV4cCI6MTYxMjE3NTU4OH0.9kHhaMcyHcbOlN6ry--YUGZ_ruyvV1JnxlwoqeFQ_1o"
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/document

Query Parameters

symptom_id  integer optional  
The 'id' of the symptom for which all documents to retrieve.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 10, maximum 100.

Body Parameters

symptom_id  integer optional  

Industry

List

requires authentication

Retrieve all industries

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/industry?sort_by=name&sort_dir=desc&page=2&per_page=20" \
    -H "X-Authorization: bgkDe86h3df1V56vEacaP4Z" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api-sbt.com/api/v1/industry"
);

let params = {
    "sort_by": "name",
    "sort_dir": "desc",
    "page": "2",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "bgkDe86h3df1V56vEacaP4Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 1,
            "name": "Auto"
        },
        {
            "id": 2,
            "name": "Off Highway"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/industry?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/industry?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/industry?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/industry",
        "per_page": 100,
        "to": 2,
        "total": 2
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/industry

Query Parameters

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Make

List

requires authentication

Retrieve all makes

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/make?industry_id=20&sort_by=name&sort_dir=asc&page=6&per_page=20" \
    -H "X-Authorization: k4316ZaacgDbf8dheEVP56v" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"industry_id":13}'
const url = new URL(
    "https://api-sbt.com/api/v1/make"
);

let params = {
    "industry_id": "20",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "6",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "k4316ZaacgDbf8dheEVP56v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "industry_id": 13
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 4,
            "industry_id": 3,
            "name": "Cummins"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/make?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/make?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/make?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/make",
        "per_page": 100,
        "to": 2,
        "total": 2
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/make

Query Parameters

industry_id  integer optional  
Filter by 'id' of the industry.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Body Parameters

industry_id  integer optional  

Model

List

requires authentication

Retrieve all models

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/model?year_id=3&sort_by=name&sort_dir=asc&page=9&per_page=20" \
    -H "X-Authorization: dh86kbfEcaePV4a1v536gZD" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"year_id":14}'
const url = new URL(
    "https://api-sbt.com/api/v1/model"
);

let params = {
    "year_id": "3",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "9",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "dh86kbfEcaePV4a1v536gZD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "year_id": 14
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 53,
            "year_id": 12,
            "name": "ISX15"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/model?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/model?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/model?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/model",
        "per_page": 100,
        "to": 4,
        "total": 4
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/model

Query Parameters

year_id  integer optional  
Filter by 'id' of the year.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Body Parameters

year_id  integer optional  

PDF

View

View documents for a symptom in PDF format. ID of the symptom is encoded in the JWT token. JWT token can be obtained from the documents list request.

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/view/repudiandae?download=" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api-sbt.com/api/v1/view/repudiandae"
);

let params = {
    "download": "",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

"File in PDF format"

Request   

GET api/v1/view/{jwt_token}

URL Parameters

jwt_token  string optional  
JWT token issued by the endpoint api/v1/document.

Query Parameters

download  boolean optional  
If true the documents are downloaded.

Email

requires authentication

Send documents in PDF format to email.

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/documents/doloribus/email?email=earum" \
    -H "X-Authorization: 1aVEhZdP66gkaecvD4b538f" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api-sbt.com/api/v1/documents/doloribus/email"
);

let params = {
    "email": "earum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "1aVEhZdP66gkaecvD4b538f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

{
    "data": "Documents are sent to john.doe@gmail.com."
}

Request   

GET api/v1/documents/{symptom_id}/email

URL Parameters

symptom_id  string optional  
The 'id' of the symptom.

Query Parameters

email  string optional  
Email address to send a PDF.

Symptom

List

requires authentication

Retrieve all symptoms

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/symptom?model_id=7&sort_by=name&sort_dir=asc&page=9&per_page=20" \
    -H "X-Authorization: a51gcV8DahP4fZebkvd6E63" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"model_id":17}'
const url = new URL(
    "https://api-sbt.com/api/v1/symptom"
);

let params = {
    "model_id": "7",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "9",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "a51gcV8DahP4fZebkvd6E63",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "model_id": 17
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 1,
            "component_id": 2,
            "name": "Coolant Loss"
        },
        {
            "id": 2,
            "component_id": 2,
            "name": "Low Power"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/symptom?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/symptom?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/symptom?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/symptom",
        "per_page": 100,
        "to": 2,
        "total": 2
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/symptom

Query Parameters

model_id  integer optional  
Filter by 'id' of the model.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Body Parameters

model_id  integer optional  

Type

List

requires authentication

Retrieve all types

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/type?make_id=20&sort_by=name&sort_dir=asc&page=16&per_page=20" \
    -H "X-Authorization: bcgv6PE5Vhdkf8aea6Z1D43" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"make_id":16}'
const url = new URL(
    "https://api-sbt.com/api/v1/type"
);

let params = {
    "make_id": "20",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "16",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "bcgv6PE5Vhdkf8aea6Z1D43",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "make_id": 16
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 2,
            "make_id": 2,
            "name": "Engine"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/type?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/type?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/type?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/type",
        "per_page": 100,
        "to": 2,
        "total": 2
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/type

Query Parameters

make_id  integer optional  
Filter by 'id' of the make.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Body Parameters

make_id  integer optional  

Year

List

requires authentication

Retrieve all years

Example request:

curl -X GET \
    -G "https://api-sbt.com/api/v1/year?type_id=5&sort_by=name&sort_dir=asc&page=19&per_page=20" \
    -H "X-Authorization: a65PgZecDda16b348vfkVEh" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"type_id":11}'
const url = new URL(
    "https://api-sbt.com/api/v1/year"
);

let params = {
    "type_id": "5",
    "sort_by": "name",
    "sort_dir": "asc",
    "page": "19",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "X-Authorization": "a65PgZecDda16b348vfkVEh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type_id": 11
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):

{
    "data": [
        {
            "id": 8,
            "type_id": 4,
            "name": "2010"
        }
    ],
    "links": {
        "first": "https:\/\/api-sbt.com\/api\/v1\/year?page=1",
        "last": "https:\/\/api-sbt.com\/api\/v1\/year?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https:\/\/api-sbt.com\/api\/v1\/year?page=1",
                "label": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https:\/\/api-sbt.com\/api\/v1\/year",
        "per_page": 100,
        "to": 12,
        "total": 12
    }
}

Example response (401):

{
    "message": "Unauthenticated."
}

Request   

GET api/v1/year

Query Parameters

type_id  integer optional  
Filter by 'id' of the type.

sort_by  string optional  
Field to sort by. Defaults to 'name'. Possible values: 'name'.

sort_dir  string optional  
Sort direction. Defaults to 'asc'. Possible values: 'asc' or 'desc'.

page  integer optional  
Page of result to return. Defaults to 1.

per_page  integer optional  
How many rows to return per page. Defaults to 100, maximum 100.

Body Parameters

type_id  integer optional