Vehicle certification

Prerequisite

You must have the Vehicle Certification server add-on to use this API.

HTTP headers

The HTTP headers used to access all RTLS APIs are listed below. Before submitting requests to the Vehicle Certifications API, set the following headers:

Header Name Example Value Description
X-User-Email admin@example.com Email of the user performing HTTP requests to the API.
X-User-Token Drv3yU7PdyqUMtr89erZ Token allowing user access to the API.
X-User-Project OfOgUA4kTs2HrmYYlFw6Jg Project identifier. Value of the project.uid field.

Set header X-USER-EMAIL

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the email address returned in the response, set: X-USER-EMAIL = data.email

Set header X-USER-TOKEN

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the authentication token returned in the response, set: X-USER-TOKEN = data.token

Set header X-USER-PROJECT

Send a request to get projects using GET api/projects/ described in the Projects API. You must send this request with headers X-USER-EMAIL and X-USER-TOKEN already set. Using the project UID returned in the response, set: X-USER-PROJECT = projects[i].uid

Vehicle certification Endpoints

Functionality Method Endpoint
get vehicle models GET api/wsc/vehicle_models
create vehicle models POST api/wsc/vehicle_models
update vehicle models PUT api/wsc/vehicle_models/:id
delete vehicle models DELETE api/wsc/vehicle_models/:id
get driver licenses GET api/wsc/driver_licenses
update driver licenses PUT api/wsc/driver_licenses
get vehicle certifications GET api/wsc/vehicle_certifications
update vehicle certifications PUT api/wsc/vehicle_certifications

Endpoints

Vehicle models

Get vehicle models

GET api/wsc/vehicle_models

Response Fields
Field Description
vehicle_models[].name Vehicle model name.
vehicle_models[].id Vehicle model ID (1 - 31). Unique within the project.
vehicle_models[].certification_required The flag that indicates if the model requires certification.
Example Response
{
  "vehicle_models": [
    {
      "name": "Model A",
      "id": 1,
      "certification_required": true
    },
    {
      "name": "Model B",
      "id": 2,
      "certification_required": false
    }
  ]
}

Create vehicle models

POST api/wsc/vehicle_models

Request Fields
Field Required Type Description
name required string Vehicle model name.
certification_required optional boolean The flag that indicates if the model requires certification. By default true.
Response Fields
Field Description
name Vehicle model name.
id Vehicle model ID (1 - 31). Unique within the project.
certification_required The flag that indicates if the model requires certification.
Example Request
{
  "name": "Model A",
  "certification_required": true
}
Example Response
{
  "name": "Model A",
  "id": 1,
  "certification_required": true
}
Errors
Error Status Error Type Error Body Description
422 ValidationError {"status":422,"details":[{"message":"\"name\" is required","path":["name"],"type":"any.required","context":{"label":"name","key":"name"}}],"stack":"ValidationError: \"name\" is required","message":"\"name\" is required","name":"ValidationError"} \"name\" is required

Update vehicle models

PUT api/wsc/vehicle_models/:id

Request Fields
Field Required Type Description
name required string Vehicle model name.
certification_required optional boolean The flag that indicates if the model requires certification. By default true.
Response Fields
Field Description
name Vehicle model name.
id Vehicle model ID (1 - 31). Unique within the project.
certification_required The flag that indicates if the model requires certification.
Example Request
{
  "name": "Model C"
}
Example Response
{
  "name": "Model C",
  "id": 2,
  "certification_required": false
}
Errors
Error Status Error Type Error Body Description
422 ValidationError {"status":422,"details":[{"message":"\"name\" is required","path":["name"],"type":"any.required","context":{"label":"name","key":"name"}}],"stack":"ValidationError: \"name\" is required","message":"\"name\" is required","name":"ValidationError"} \"name\" is required

Delete vehicle models

DELETE api/wsc/vehicle_models/:id

Successful request returns a status of 204.

Errors
Error Status Error Type Error Body Description
404 NotFoundError: {"status":422, "message":"Model 3 not found","name":"NotFoundError"} Model ... not found

Driver licenses

Get driver licenses

GET api/wsc/driver_licenses

Response Fields
Field Description
driver_licenses[].obj_uid The unique identifier of the trackable.
driver_licenses[].licenses.name Certification model name.
driver_licenses[].licenses.id Certification model ID (1 - 31).
driver_licenses[].licenses.certification_required The flag that indicates if the model requires certification.
Example Response
{
  "driver_licenses": [
    {
      "obj_uid": "-_phVD7JSjCWjEa-i5VK3Q",
      "licenses": [
        {
          "name": "Model C",
          "certification_required": false,
          "id": 2
        }
      ]
    }
  ]
}

Update driver licenses

PUT api/wsc/driver_licenses

Request Fields
Field Required Type Description
obj_uid required string The unique identifier of the trackable.
licenses required Array(number) The list of driver certification models.
Response Fields
Field Description
obj_uid The unique identifier of the trackable.
licenses.name Certification model name.
licenses.id Certification model ID (1 - 31).
licenses.certification_required The flag that indicates if the model requires certification.
Example Request
{
  "obj_uid": "-_phVD7JSjCWjEa-i5VK3Q",
  "licenses": [ 2 ]
}
Example Response
{
  "obj_uid": "-_phVD7JSjCWjEa-i5VK3Q",
  "licenses": [
    {
      "name": "Model C",
      "certification_required": false,
      "id": 2
    }
  ]
}

Vehicle certifications

Get vehicle certifications

GET api/wsc/vehicle_certifications

Response Fields
Field Description
vehicle_certifications[].obj_uid The unique identifier of the trackable.
vehicle_certifications[].name Certification model name.
vehicle_certifications[].id Certification model ID (1 - 31).
vehicle_certifications[].certification_required The flag that indicates if vehicle model requires a licensed driver.
Example Response
{
  "vehicle_certifications": [
    {
      "obj_uid": "SRJy3hfmRceht2w_KhkzqA",
      "name": "Model C",
      "id": 2,
      "certification_required": false
    }
  ]
}

Update vehicle certifications

PUT api/wsc/vehicle_certifications

Request Fields
Field Required Type Description
obj_uid required string The unique identifier of the trackable.
id required number Certification model ID (1 - 31).
certification_required required number The flag that indicates if vehicle model requires a licensed driver.
Response Fields
Field Description
obj_uid The unique identifier of the trackable.
name Certification model name.
id Certification model ID (1 - 31).
certification_required The flag that indicates if vehicle model requires a licensed driver.
Example Request
{
  "obj_uid": "Pot1YvKnRaWr_wkJhlIB2g",
  "id": 2,
  "certification_required": false
}
Example Response
{
  "obj_uid": "Pot1YvKnRaWr_wkJhlIB2g",
  "name": "Model C",
  "id": 2,
  "certification_required": false
}

results matching ""

    No results matching ""