Fleet

A collection of Drivers

The Fleet object

Property Type Description
id uuid string Unique identifier for the object
name string Name of the fleet
created_at ISO datetime string Timestamp of when fleet was created
modified_at ISO datetime string Timestamp of when fleet was modified

Create a Fleet

Creates a new fleet object.

HTTP Request

POST https://app.hypertrack.io/api/v1/fleets/

Returns

Returns a fleet object if the call succeeded.

Parameters

Parameter Required Description
name Yes Name of the fleet
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "{\"name\": \"Southern fleet\"}" \
     https://app.hypertrack.io/api/v1/fleets/

Example response

{
  "id": "f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
  "name": "Southern fleet",
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Retrieve a Fleet

Retrieves a fleet object with the id.

HTTP Request

GET https://app.hypertrack.io/api/v1/fleets/<id>/

Returns

Returns a fleet object if a valid identifier was provided.

curl -H "Authorization: token YOUR_PK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/fleets/f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a/

Example response

{
  "id": "f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
  "name": "Fleet name",
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Update a Fleet

Edit an existing fleet object.

HTTP Request

PATCH https://app.hypertrack.io/api/v1/fleets/<id>/

Returns

Returns the updated fleet object.

Parameters

Parameter Required Description
name Yes Name of the fleet
curl -H "Authorization: token $ask" \
     -H "Content-Type: application/json" \
     -X PATCH \
     -d "{\"name\": \"Name changed\"}" \       
     https://app.hypertrack.io/api/v1/fleets/16d3d307-21e4-42b9-aa59-ac9a2ae43c65/

Example response

{
  "id": "16d3d307-21e4-42b9-aa59-ac9a2ae43c65",
  "name": "Name changed",
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Delete a Fleet

Delete an existing fleet object.

HTTP Request

DELETE https://app.hypertrack.io/api/v1/fleets/<id>/

Returns

Empty response if the object is deleted.

curl -H "Authorization: token YOUR_SK_TOKEN" \
     -X DELETE \
     https://app.hypertrack.io/api/v1/fleets/f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a/

Example response

{}

List all Fleets

List all fleet objects. The list can be filtered using the following parameters.

HTTP Request

GET https://app.hypertrack.io/api/v1/fleets/

Returns

Returns a list of fleets.

Parameters

Parameter Required Description
page_size No Maximum number of objects to return, default is 50
name No Filter fleets with names that contain this string
min_date No Filter objects by minimum created at date
max_date No Filter objects by maximum created at date
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/fleets/?page_size=20

Example response

{
  "count":1,
  "next":null,
  "previous":null,
  "results":[
    {
      "id":"f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
      "name":"North fleet",
      "created_at":"2016-03-09T05:20:19.742229Z",
      "modified_at":"2016-03-09T05:20:19.742257Z"
    }
  ]
}

results matching ""

    No results matching ""