> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectedfleet.michelin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tacho Activity

> Returns historical driver tacho activities.



## OpenAPI

````yaml /api-reference/tacho.json post /bvfm/services/public/v1/customer/{customerId}/tacho/activity
openapi: 3.0.1
info:
  title: public-api
  description: Public API Gateway
  version: 1.0.1
servers:
  - url: https://public-api.masternautconnect.com
security: []
tags:
  - name: /tacho
    description: Live tracking operations
paths:
  /bvfm/services/public/v1/customer/{customerId}/tacho/activity:
    post:
      tags:
        - /tacho
      summary: Tacho Activity
      description: Returns historical driver tacho activities.
      operationId: tachoActivity
      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityRequest'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityResponse'
        '400':
          description: 400 response, bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 401 response, not authorized or no valid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: 403 response, Forbiden don't have access to the feature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - tacAuthorizer: []
components:
  schemas:
    ActivityRequest:
      type: object
      properties:
        driverKeys:
          type: array
          description: >-
            MUST be identical to the full key unique 14 character chars and
            issue number
          items:
            type: string
        registrations:
          type: array
          items:
            type: string
          description: >-
            MUST be identical to the vehicle registration registered with
            Connect.
        startTime:
          type: string
          description: >-
            The start date and time for the period, in UTC, in format of
            YYYY-MM-DDThh:mm:ss
        endTime:
          type: string
          description: >-
            The end date and time for the period, in UTC, in format of
            YYYY-MM-DDThh:mm:ss
        dataContent:
          type: string
          enum:
            - live
            - DDD
          description: DEPRECATED
        skip:
          type: integer
          description: >-
            Number of records to be skipped before the beginning of the result
            set. This acts as an offset from the first record matching the
            request parameters.
        limit:
          type: integer
          description: Limit the number of records to return in the response
        sort:
          type: object
          description: >-
            Object contain direction and field path to sort. Sets the sort order
            to be either ascending (ASC) or descending (DESC)
          properties:
            driverId:
              type: string
            driverKey:
              type: string
            activities.assetId:
              type: string
            activities.startTime:
              type: string
            activities.type:
              type: string
            activities.activity:
              type: string
            activities.startLatitude:
              type: string
            activities.startLongitude:
              type: string
            activities.endTime:
              type: string
            activities.endLatitude:
              type: string
            activities.endLongitude:
              type: string
            activities.vehicleFriendlyName:
              type: string
            activities.driverCardSlot:
              type: string
            activities.isStartOfShift:
              type: string
            activities.isEndOfShift:
              type: string
      required:
        - startTime
        - endTime
    ActivityResponse:
      type: object
      properties:
        count:
          type: integer
          description: Total number of records found
        data:
          type: array
          description: List of drivers
          items:
            type: object
            properties:
              driverId:
                type: string
                description: Connect driver identifier
              driverKey:
                type: string
                description: Tacho driver key
              activities:
                type: array
                description: See tacho activity fields table
                items:
                  type: object
                  properties:
                    assetId:
                      type: string
                      description: Connect vehicle identifier
                    inProgress:
                      type: boolean
                      description: >-
                        Indicates whether the activity block is currently open
                        (true) or closed by a further activity (false)
                    assetRegistration:
                      type: string
                      description: Vehicle Registration Number (VRN)
                    startTime:
                      type: string
                      description: Start date and time in UTC of the tacho activity
                    type:
                      type: string
                      description: TACHO, INFRINGEMENT
                    activity:
                      type: string
                      description: |-
                        When "type" is TACHO.
                        Possible values of "activity" are :
                        RESTING
                        AVAILABLE
                        WORKING
                        DRIVING
                        DRIVER_CARD_EJECTED
                    startLatitude:
                      type: number
                      description: Asset latitude position when the activity starts
                    startLongitude:
                      type: number
                      description: Asset longitude position when the activity starts
                    duration:
                      type: integer
                      description: Activity duration (mins)
                    endTime:
                      type: string
                      description: End date and time in UTC of the tacho activity
                    endLatitude:
                      type: number
                      description: Asset latitude position when the activity ends
                    endLongitude:
                      type: number
                      description: Asset longitude position when the activity ends
                    flagDDD:
                      type: boolean
                      description: >-
                        Indicates what is the data source of the activity. True:
                        the activity is from DDD. False: the activity has been
                        generated in real-time by the platform
                    flagManualEntry:
                      type: boolean
                      description: >-
                        Indicates whether the activity was manually entered
                        (true) or automatically generated (false)
                    vehicleFriendlyName:
                      type: string
                    driverCardSlot:
                      type: integer
                    isStartOfShift:
                      type: boolean
                    isEndOfShift:
                      type: boolean
                    distance:
                      type: number
                  required:
                    - assetId
                    - assetRegistration
                    - startTime
                    - type
                    - activity
                    - startLatitude
                    - startLongitude
                    - duration
                    - endTime
                    - endLatitude
                    - endLongitude
            required:
              - driverId
              - driverKey
              - activities
      required:
        - count
        - data
    ErrorResponse:
      type: object
      properties:
        errorCode:
          type: integer
        errorMessage:
          type: string
      required:
        - errorCode
        - errorMessage
  securitySchemes:
    tacAuthorizer:
      type: apiKey
      name: Authorization
      description: >-
        Authorization header containing a Bearer token of the form Bearer
        [token], where [token] is a JWT used to authorize the request
      in: header
      x-amazon-apigateway-authtype: Custom authorization scheme using Masternauth for Tacho
      x-amazon-apigateway-authorizer:
        type: token
        identitySource: method.request.header.Authorization
        authorizerCredentials: arn:aws:iam::${aws_account}:role/mn_tac_public_api_invoke_lambda_role
        authorizerUri: >-
          arn:aws:apigateway:${aws_region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${aws_region}:${aws_account}:function:mn_awssvc_api_authorizer_service_public_lambda_${env}/invocations
        authorizerResultTtlInSeconds: 300

````