Automile ResourceOwnerTripV2 API

The ResourceOwnerTripV2 API from Automile — 17 operation(s) for resourceownertripv2.

OpenAPI Specification

automile-resourceownertripv2-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: Automile ClientApi ResourceOwnerTripV2 API
  version: v1
tags:
- name: ResourceOwnerTripV2
paths:
  /v1/resourceowner/trips:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get all trips that the user has access to
      description: Only returns trips that the user have access to. If more then 60 days are requested it defaults to 30 days.
      operationId: GetResourceOwnerTrips
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: query
        name: lastNumberOfDays
        description: Optional enter last number of days to get trips for. Only supports up to 60 days back. If not speficied or more then 60 days are entered it searches 30 days back.
        type: integer
        format: int32
      - in: query
        name: vehicleId
        description: Optional vehicle id to get trips for
        type: integer
        format: int32
      - in: query
        name: synchronized
        description: Optional include synchronized trips (defaults to true)
        type: boolean
        default: true
      - in: query
        name: fromUtc
        description: Retrieve trips from this date. (Can't be used if lastNumberOfDays is specified)
        type: string
        format: date-time
      - in: query
        name: toUtc
        description: Retrieve trips to this date. (Can't be used if lastNumberOfDays is specified)
        type: string
        format: date-time
      responses:
        '200':
          description: Success
          schema:
            type: array
            items:
              $ref: '#/definitions/TripModel'
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the details about the trip
      description: Only trips that are associated with the vehicles that user has relationships with are allowed.
      operationId: GetResourceOwnerTrip
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The trip details are returned
          schema:
            $ref: '#/definitions/TripDetailModel'
        '403':
          description: Request is forbidden, meaning you don't have access to this trip
        '500':
          description: Internal server error
      security:
      - oauth2: []
    put:
      tags:
      - ResourceOwnerTripV2
      summary: Updates the given trip with a trip type (category) and trip tags
      description: This operation would only update the trip type and trip tags if authorized for this trip.
      operationId: EditResourceOwnerTrip
      consumes:
      - application/json
      - text/json
      - application/*+json
      parameters:
      - in: path
        name: tripId
        description: The trip id to update
        required: true
        type: integer
        format: int32
      - in: body
        name: body
        description: The triptype and triptags to update
        schema:
          $ref: '#/definitions/TripEditModel'
      responses:
        '200':
          description: The trip was saved
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/geostartend:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the trip start and stop geo locations
      description: Only trips that are associated with the vehicles that user has relationships with are allowed.
      operationId: GetResourceOwnerGeoStartStop
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The Start and stop geo locations details are returned
          schema:
            $ref: '#/definitions/TripStartEndGeoModel'
        '403':
          description: Request is forbidden, meaning you don't have access to this trip
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/speed:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the vehicle speed if it's reported by the vehicle
      description: This is a quick method, instead of retrieving raw data with the pid operation. Is reported in km/h.
      operationId: GetResourceOwnerTripSpeed
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The vehicle speeds are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/VehicleSpeedModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/rpm:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the vehicle engine rpm if it's reported by the vehicle
      description: This is a quick method, instead of retrieving raw data with the pid operation.
      operationId: GetResourceOwnerTripRPM
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The vehicle engine rpm are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/RPMModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/ambienttemperature:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the vehicle ambient (outside) temperature if it's reported by the vehiclee
      description: This is a quick method, instead of retrieving raw data with the pid operation. The result is in celsius.
      operationId: GetResourceOwnerTripAmbientTemperature
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: Te list of all ambient temperatures are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/AmbientAirTemperatureModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/fuellevelinput:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the vehicle current fuel level if it's reported by the vehicle
      description: This is a quick method, instead of retrieving raw data with the pid operation. The result is in percentage of total 100
      operationId: GetResourceOwnerTripFuelLevelInput
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The recorded fuel level details are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/FuelLevelInputModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/enginecoolanttemperature:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the engine coolant temperature if it's reported by the vehicle
      description: This is a quick method, instead of retrieving raw data with the pid operation
      operationId: GetResourceOwnerTripEngineCoolantTemperature
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The engine coolant temperature are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/EngineCoolantTemperatureModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/pid/{pidId}:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: This will get the raw PID data if the vehicle has reported that it is being recorded
      description: The data array will contain a sub-array of integers representing the raw data
      operationId: GetResourceOwnerTripPid
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      - in: path
        name: pidId
        description: The PID id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: ThePID data are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/PIDModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/geo:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the gps locations for the vehicle, includes position and heading
      description: This operation would require compression enabled by the client.
      operationId: GetResourceOwnerTripGeo
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      - in: query
        name: everyNthRecord
        description: Optional if you wish to limit to n:th number of records
        type: integer
        format: int32
        default: 1
      - in: query
        name: snapToRoad
        description: ''
        type: boolean
        default: true
      responses:
        '200':
          description: The Geo data are returned
          schema:
            type: array
            items:
              $ref: '#/definitions/TripGeoModel'
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/googleurltostaticmapencodedpolyline:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Gets Google static map URL with the trip route as a polyline
      operationId: GetGoogleurlToStaticMapEncodedPolyline
      produces:
      - text/plain
      - application/json
      - text/json
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      - in: query
        name: height
        description: Height of the map
        type: integer
        format: int32
      - in: query
        name: width
        description: Width of the map
        type: integer
        format: int32
      responses:
        '200':
          description: The Google Map Url are returned
          schema:
            type: string
        '400':
          description: Bad request, this operation explicitly require gzip compression by the client
        '501':
          description: Not implemented, meaning the PID is not supported or is not recorded by the vehicle
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/addnotestolasttrip:
    put:
      tags:
      - ResourceOwnerTripV2
      summary: Updates the last trip with trip notes
      description: This operation would only update the trip tags if authorized for this trip.
      operationId: EditResourceOwnerTripAddNoteToLastTrip
      consumes:
      - application/json
      - text/json
      - application/*+json
      parameters:
      - in: body
        name: body
        description: The triptags to update
        schema:
          $ref: '#/definitions/TripAddNoteModel'
      responses:
        '200':
          description: The trip was saved
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/batch/triptype:
    put:
      tags:
      - ResourceOwnerTripV2
      summary: Updates a list of trip id's with the provided trip type
      description: This operation only updates the trip types if authorized to all trips in list.
      operationId: ResourceOwnerTripController_TripTypeBatchUpdate
      consumes:
      - application/json
      - text/json
      - application/*+json
      parameters:
      - in: body
        name: body
        description: The trip type and trips to update
        schema:
          $ref: '#/definitions/TripTypeBatchUpdateModel'
      responses:
        '200':
          description: The trips was saved
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/setdriverontrip:
    put:
      tags:
      - ResourceOwnerTripV2
      summary: Updates the given trip with given contactid
      description: This operation would only update the driver if authorized for this trip.
      operationId: SetDriverOnTrip
      parameters:
      - in: query
        name: tripId
        description: The trip to update
        type: integer
        format: int32
      - in: query
        name: contactId
        description: The contact id for the driver
        type: integer
        format: int32
      responses:
        '200':
          description: The trip was saved
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/synchronized:
    post:
      tags:
      - ResourceOwnerTripV2
      summary: Mark trips as synchronized, synchronized trips will not be returned when fetching trips
      description: This operation only updates the synchronized state if authorized to all trips in list.
      operationId: Synchronized
      consumes:
      - application/json
      - text/json
      - application/*+json
      parameters:
      - in: body
        name: body
        description: Trips to mark as synchronized
        schema:
          $ref: '#/definitions/TripSynchronized'
      responses:
        '200':
          description: Success
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/details:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the details about the trip including driving events, speeding and idling
      description: Only trips that are associated with the vehicles that user has relationships with are allowed.
      operationId: GetResourceOwnerTrip2
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The trip details are returned
        '403':
          description: Request is forbidden, meaning you don't have access to this trip
        '500':
          description: Internal server error
      security:
      - oauth2: []
  /v1/resourceowner/trips/{tripId}/advanced:
    get:
      tags:
      - ResourceOwnerTripV2
      summary: Get the advanced details about the trip including driving events, speeding, idling, speed and rpm data series
      description: Only trips that are associated with the vehicles that user has relationships with are allowed.
      operationId: GetResourceOwnerTripAdvanced
      parameters:
      - in: path
        name: tripId
        description: The trip id
        required: true
        type: integer
        format: int32
      responses:
        '200':
          description: The trip advanced data are returned
        '403':
          description: Request is forbidden, meaning you don't have access to this trip
        '500':
          description: Internal server error
      security:
      - oauth2: []
definitions:
  TripTypeBatchUpdateModel:
    type: object
    properties:
      TripType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      CustomCategory:
        type: string
      TripIdList:
        type: array
        items:
          format: int32
          type: integer
    additionalProperties: false
  VehicleSpeedModel:
    description: PID013
    type: object
    properties:
      SpeedKmPerHour:
        format: double
        type: number
      RecordTimeStamp:
        format: date-time
        type: string
    additionalProperties: false
  TripDetailModel:
    type: object
    properties:
      TripId:
        format: int32
        type: integer
      IMEI:
        type: string
      TripStartDateTime:
        format: date-time
        type: string
      TripStartTimeZone:
        format: int32
        type: integer
      TripStartODOMeter:
        format: int32
        type: integer
      TripNumber:
        format: int32
        type: integer
      NumberOfSupportedPIDs:
        format: int32
        type: integer
      VehicleIdentificationNumber:
        type: string
      VechicleProtocol:
        type: string
      TripEndDateTime:
        format: date-time
        type: string
      TripEndTimeZone:
        format: int32
        type: integer
      TripEndODOMeter:
        format: int32
        type: integer
      TripStartFormattedAddress:
        type: string
      TripEndFormattedAddress:
        type: string
      TripStartCustomAddress:
        type: string
      TripEndCustomAddress:
        type: string
      TripType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      TripTags:
        type: string
      VehicleId:
        format: int32
        type: integer
      FuelInLiters:
        format: double
        type: number
      TripLengthInKilometers:
        format: double
        type: number
      TripLengthInMinutes:
        format: int32
        type: integer
      IdleTimeInSecondsAllTrip:
        format: int32
        type: integer
      IdleTimeInSecondsFromStart:
        format: int32
        type: integer
      IdleRPMMax:
        format: int32
        type: integer
      MaxSpeed:
        format: int32
        type: integer
      MaxRPM:
        format: int32
        type: integer
      CO2EmissionInGrams:
        format: double
        type: number
      OdometerInKilometersAfterTripEnded:
        format: double
        type: number
      AverageSpeedInKilometersPerHour:
        format: double
        type: number
      TripStartOutsideTemperatureInCelsius:
        format: double
        type: number
      DriverContactId:
        format: int32
        type: integer
      HasDrivingEvents:
        type: boolean
      CustomCategory:
        type: string
      HideStartRoute:
        type: boolean
      HideEndRoute:
        type: boolean
      VehicleType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 255
        type: integer
      TripApprovalStatus:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      IsMerged:
        type: boolean
      HasGermanTaxRules:
        type: boolean
      BusinessContact:
        type: string
      BusinessContactCompany:
        type: string
      TripReason:
        type: string
      IsLocked:
        type: boolean
        readOnly: true
      LockReason:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 4
        type: integer
    additionalProperties: false
  EngineCoolantTemperatureModel:
    description: PID05
    type: object
    properties:
      TemperatureInCelsius:
        format: double
        type: number
      RecordTimeStamp:
        format: date-time
        type: string
    additionalProperties: false
  TripAddNoteModel:
    type: object
    properties:
      TripTags:
        type: array
        items:
          type: string
    additionalProperties: false
  TripGeoModel:
    type: object
    properties:
      RecordTimeStamp:
        format: date-time
        type: string
      Latitude:
        format: double
        type: number
      Longitude:
        format: double
        type: number
      HeadingDegrees:
        format: int32
        type: integer
      NumberOfSatellites:
        format: int32
        type: integer
      HDOP:
        format: int32
        type: integer
    additionalProperties: false
  TripSynchronized:
    type: object
    properties:
      Trips:
        type: array
        items:
          format: int32
          type: integer
    additionalProperties: false
  RPMModel:
    description: PID012
    type: object
    properties:
      RPMValue:
        format: double
        type: number
      RecordTimeStamp:
        format: date-time
        type: string
    additionalProperties: false
  TripEditModel:
    type: object
    properties:
      CustomCategory:
        type: string
      TripType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      TripTags:
        type: array
        items:
          type: string
      LastEditedByContactId:
        format: int32
        type: integer
      BusinessContact:
        type: string
      BusinessContactCompany:
        type: string
      TripReason:
        type: string
    additionalProperties: false
  PIDModel:
    type: object
    properties:
      Data:
        format: byte
        type: string
      RecordTimeStamp:
        format: date-time
        type: string
      Value:
        format: double
        type: number
    additionalProperties: false
  TripStartEndGeoModel:
    type: object
    properties:
      StartLatitude:
        format: double
        type: number
      StartLongitude:
        format: double
        type: number
      EndLatitude:
        format: double
        type: number
      EndLongitude:
        format: double
        type: number
    additionalProperties: false
  AmbientAirTemperatureModel:
    description: PID70
    type: object
    properties:
      TemperatureInCelsius:
        format: double
        type: number
      RecordTimeStamp:
        format: date-time
        type: string
    additionalProperties: false
  FuelLevelInputModel:
    description: PID012
    type: object
    properties:
      FuelLevelInPercentage:
        format: double
        type: number
      RecordTimeStamp:
        format: date-time
        type: string
    additionalProperties: false
  TripModel:
    type: object
    properties:
      TripId:
        format: int32
        type: integer
      TripStartDateTime:
        format: date-time
        type: string
      TripEndDateTime:
        format: date-time
        type: string
      DistanceKilometers:
        format: double
        type: number
      FuelConsumptionInLiters:
        format: double
        type: number
      TripStartFormattedAddress:
        type: string
      TripEndFormattedAddress:
        type: string
      TripStartCustomAddress:
        type: string
      TripEndCustomAddress:
        type: string
      VehicleId:
        format: int32
        type: integer
      TripType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      DriverContactId:
        format: int32
        type: integer
      HasSpeedingViolation:
        type: boolean
      HasIdlingEvent:
        type: boolean
      HasAccelerationEvent:
        type: boolean
      HasAccident:
        type: boolean
      HasTurningEvent:
        type: boolean
      HasBrakingEvent:
        type: boolean
      ParkedForMinutesUntilNextTrip:
        format: int32
        type: integer
      HasDrivingEvents:
        type: boolean
      CustomCategory:
        type: string
      TripTags:
        type: string
      HideStartRoute:
        type: boolean
      HideEndRoute:
        type: boolean
      VehicleType:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 255
        type: integer
      TripApprovalStatus:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 3
        type: integer
      IsMerged:
        type: boolean
      HasGermanTaxRules:
        type: boolean
      IsLocked:
        type: boolean
      LockReason:
        format: int32
        enum:
        - 0
        - 1
        - 2
        - 4
        type: integer
      TripStartCountry:
        type: string
      TripStartPostalCode:
        type: string
      TripEndCountry:
        type: string
      TripEndPostalCode:
        type: string
    additionalProperties: false
securityDefinitions:
  oauth2:
    type: oauth2
    flow: implicit
    authorizationUrl: https://api.automile.com/login/
    scopes:
      read: Read access to protected resources
      write: Write access to protected resources
    description: OAuth2 Implicit Grant