---
title: "Get Vehicle's Last Location by Dispatch ID"
url: "https://api-docs.centraldispatch.com/apis/fulfillment-api-1-0-0/versions/ed4f06d9-fab0-4a1d-a6a8-ce631f6542d0/operations/getLastVehicleLocationByDispatchId"
---

> Full API specification: https://api-docs.centraldispatch.com/apis/fulfillment-api-1-0-0/versions/ed4f06d9-fab0-4a1d-a6a8-ce631f6542d0.md

# Get Vehicle's Last Location by Dispatch ID

`GET` `/api/fulfillments/vehicle-locations/dispatchId/{dispatchId}/last-vehicle-location`

Operation ID: `getLastVehicleLocationByDispatchId`

Get the latitude/longitude position of the latest vehicle location by dispatch ID. #### 📝 Important Notes - Tracking data is only available if the vehicle was inspected and marked `PICKED_UP` using the Central Dispatch mobile application. - Location tracking must be enabled on the device used to perform the pick up inspection. - This location may be slightly shifted to protect the privacy of the carrier.

## Path parameters

- `dispatchId` (string, uuid, required) - The ID of the dispatch.

## Header parameters

- `Accept` (string, required) - The major version of the API to make a request against. This is a custom MIME type that contains `vnd.coxauto.v[#]+`. For example, to request a resource from version 1.x.x of an API, the Accept header should be set to `application/vnd.coxauto.v1+json`.

## Responses

- `200` - OK. Successful request.
- `401` - Unauthorized. Authentication failed or missing.
- `403` - Forbidden. The attempted action is not permitted.
- `404` - Not Found.
- `429` - Too Many Requests. Rate limit exceeded.
- `500` - Error.
- `503` - Service Unavailable. Temporary service interruption.

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Fulfillment API
  version: 1.0.0
servers:
  - url: https://fulfillment-api.centraldispatch.com
    description: Production server
paths:
  /api/fulfillments/vehicle-locations/dispatchId/{dispatchId}/last-vehicle-location:
    get:
      tags:
        - Dispatch
      summary: Get Vehicle's Last Location by Dispatch ID
      description: >
        
        Get the latitude/longitude position of the latest vehicle location by
        dispatch ID. 


        #### 📝 Important Notes

        - Tracking data is only available if the vehicle was inspected and
        marked `PICKED_UP` using the Central Dispatch mobile application. 

        - Location tracking must be enabled on the device used to perform the
        pick up inspection.

        - This location may be slightly shifted to protect the privacy of the
        carrier.
      operationId: getLastVehicleLocationByDispatchId
      parameters:
        - name: dispatchId
          in: path
          description: The ID of the dispatch.
          required: true
          schema:
            type: string
            format: uuid
          example: d159acc0-e89b-12d3-a456-426614174000
        - name: Accept
          in: header
          description: The major version of the API to make a request against. This is a
            custom MIME type that contains `vnd.coxauto.v[#]+`. For example, to
            request a resource from version 1.x.x of an API, the Accept header
            should be set to `application/vnd.coxauto.v1+json`.
          required: true
          schema:
            type: string
          example: application/vnd.coxauto.v1+json
      responses:
        "200":
          description: OK. Successful request.
          headers:
            X-CoxAuto-Media-Type:
              description: Contains the major version and format information.
              schema:
                type: string
              example: coxauto.v1; format=json
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VehicleLocationResponse"
        "401":
          description: Unauthorized. Authentication failed or missing.
        "403":
          description: Forbidden. The attempted action is not permitted.
        "404":
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorsAlt"
        "429":
          description: Too Many Requests. Rate limit exceeded.
        "500":
          description: Error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorsAlt"
        "503":
          description: Service Unavailable. Temporary service interruption.
      security:
        - Bearer: []
security:
  - Bearer: []
components:
  schemas:
    VehicleLocationResponse:
      type: object
      properties:
        href:
          type: string
          description: The fully qualified URL of the dispatch.
          nullable: true
          example: https://fulfillment-api.centraldispatch.com/api/fulfillments/id/d159acc0-e89b-12d3-a456-426614174000
        vehicleId:
          type: string
          description: The ID of the vehicle.
          format: uuid
          example: b331c130-e89b-12d3-a456-426614174000
        dispatchId:
          type: string
          description: The ID of the dispatch.
          format: uuid
          example: d159acc0-e89b-12d3-a456-426614174000
        userId:
          type: string
          description: The Central Dispatch user ID.
          format: uuid
          example: d71b5750-e89b-12d3-a456-426614174000
        vehicleTrackingDeviceId:
          type: string
          description: The vehicle tracking device ID.
          nullable: true
          example: 2539f4b4-d3d6-45db-8df3-7ba768caba9b
        eventType:
          $ref: "#/components/schemas/EventType"
        lastVehicleLocationId:
          type: string
          description: The location ID of the vehicle's last location.
          format: uuid
          nullable: true
          example: 3fde6068-5fa2-4ae4-af16-06d65fc87dc9
        latitude:
          type: number
          description: The latitude of the location.
          format: double
          example: 33.81228788622535
        longitude:
          type: number
          description: The longitude of the location.
          format: double
          example: -117.91836265987132
        locationDateUtc:
          type: string
          description: The date and time of the vehicle's last location, in UTC/ISO 8601
            format.
          format: date-time
          example: 2024-10-15T00:00:00Z
      description: Details of a vehicle's location.
    ErrorsAlt:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: "#/components/schemas/ErrorAlt"
          description: A collection of errors.
          nullable: true
      description: An error occurred, and the request could not be completed.
    EventType:
      enum:
        - PICKED_UP
        - IN_TRANSIT
        - DELIVERED
      description: The event type. This list is not exhaustive and additional values
        may be added at any time.
      example: IN_TRANSIT
    ErrorAlt:
      type: object
      properties:
        errorID:
          type: string
          description: The ID of the error.
          nullable: true
          example: 157a16f0-503d-4256-ba60-a4876e8eb9bb
        code:
          type: string
          description: The code used for the issue.
          nullable: true
          example: resource.issue_type
        description:
          type: string
          description: A detailed message.
          nullable: true
          example: The issue happened because something is wrong.
        properties:
          type: array
          items:
            $ref: "#/components/schemas/ErrorAltProperty"
          description: Properties related to the issue.
          nullable: true
      description: Details of an error or issue.
    ErrorAltProperty:
      type: object
      properties:
        property:
          type: string
          description: The name of the property.
          nullable: true
          example: person
        value:
          type: string
          description: The value of the property.
          nullable: true
          example: J0hn D03
      description: Details of an error's property.
  securitySchemes:
    Bearer:
      type: http
      scheme: Bearer
```
