openapi: 3.2.0 info: title: Automile Resource Owner Reports API version: v1 tags: - name: ResourceOwnerReports paths: /v1/resourceowner/reports/approved-trips-summary: get: tags: - ResourceOwnerReports summary: Get trip approval and mileage statistics for a vehicle in a date period description: 'Statistics include all trips in the period. Approval is evaluated using the customer''s trip approval configuration, but does not honor the integration-specific setting which allows unapproved trips to be exported.' operationId: GetApprovedTripsSummary parameters: - in: query name: fromDate description: First local date to include. schema: type: string format: date-time - in: query name: toDate description: Last local date to include. schema: type: string format: date-time - in: query name: vehicleId description: Vehicle to report. schema: type: integer format: int32 responses: '200': description: The trip approval and mileage summary is returned. content: text/plain: schema: $ref: '#/components/schemas/ApprovedTripsSummaryResponse' application/json: schema: $ref: '#/components/schemas/ApprovedTripsSummaryResponse' text/json: schema: $ref: '#/components/schemas/ApprovedTripsSummaryResponse' '400': description: The date period or vehicle id is invalid. '403': description: The user is not authorized to view trips for the vehicle. security: - oauth2: [] /v1/resourceowner/reports/trips-report: post: tags: - ResourceOwnerReports summary: Trips report description: Max date interval is 16 days operationId: GetTripReport responses: '200': description: The vehicle summary report is returned content: text/plain: schema: $ref: '#/components/schemas/TripsReportResponse' application/json: schema: $ref: '#/components/schemas/TripsReportResponse' text/json: schema: $ref: '#/components/schemas/TripsReportResponse' '400': description: Exceeded date range allowed '401': description: Not authorized to all supplied vehicles '500': description: Internal server error security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/TripsReportRequestModel' text/json: schema: $ref: '#/components/schemas/TripsReportRequestModel' application/*+json: schema: $ref: '#/components/schemas/TripsReportRequestModel' /v1/resourceowner/reports/vehicle-summary: get: tags: - ResourceOwnerReports summary: Vehicle summary report description: 'Only vehicles that the user is associated with will be returned by this operation. 400 bad request is returned if the date period parameter is not in a correct format' operationId: GetVehicleSummary parameters: - in: query name: fromDate description: Period from date schema: type: string format: date-time - in: query name: toDate description: Period to date schema: type: string format: date-time - in: query name: page description: First page = 1, page size 20 schema: type: integer format: int32 default: 1 - in: query name: vehicleId description: Filter on vehicleId schema: type: integer format: int32 responses: '200': description: The vehicle summary report is returned content: text/plain: schema: $ref: '#/components/schemas/VehiclesSummaryReportModel' application/json: schema: $ref: '#/components/schemas/VehiclesSummaryReportModel' text/json: schema: $ref: '#/components/schemas/VehiclesSummaryReportModel' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/reports/tripsummary/{dateperiod}: get: tags: - ResourceOwnerReports summary: Get a trip summary report description: Only vehicles that the user is associated with will be returned by this operation. 400 bad request is returend if the date period parameter is not in a correct format operationId: GetTripSummaryReport parameters: - in: path name: dateperiod description: Date period parameter, in the form of only year (2014), year and month (201401), or interval {201301-201401} required: true schema: type: string responses: '200': description: The trip summary report are returned content: text/plain: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' application/json: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' text/json: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' '500': description: Internal server error '400': description: Bad request, date period is not in a correct format security: - oauth2: [] /v1/resourceowner/reports/tripsummary/{dateperiod}/{vehicleId}: get: tags: - ResourceOwnerReports summary: Get a trip summary report filtered by vehicle description: Only vehicles that the user is associated with will be returned by this operation. 400 bad request is returend if the date period parameter is not in a correct format operationId: GetTripSummaryReporByVehicleId parameters: - in: path name: dateperiod description: Date period parameter, in the form of only year (2014), year and month (201401), or interval {201301-201401} required: true schema: type: string - in: path name: vehicleId description: Report will be filtered on vehicle Id required: true schema: type: integer format: int32 responses: '200': description: The trip summary report are returned content: text/plain: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' application/json: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' text/json: schema: type: array items: $ref: '#/components/schemas/TripSummaryReportModel' '500': description: Internal server error '400': description: Bad request, date period is not in a correct format security: - oauth2: [] /v1/resourceowner/reports/vehiclesummary/{dateperiod}/{vehicleId}: get: tags: - ResourceOwnerReports summary: Get a vehicle summary report description: Only vehicles that the user is associated with will be returned by this operation. 400 bad request is returend if the date period parameter is not in a correct format operationId: GetVehicleSummaryReportByVehicleId parameters: - in: path name: dateperiod description: Date period parameter, in the form of only year (2014), year and month (201401), or interval {201301-201401} required: true schema: type: string - in: path name: vehicleId description: Report will be filtered on vehicle Id required: true schema: type: integer format: int32 responses: '200': description: The vehicle summary report returned content: text/plain: schema: $ref: '#/components/schemas/VehicleSummaryModel' application/json: schema: $ref: '#/components/schemas/VehicleSummaryModel' text/json: schema: $ref: '#/components/schemas/VehicleSummaryModel' '500': description: Internal server error '400': description: Bad request, date period is not in a correct format security: - oauth2: [] /v1/resourceowner/reports/vehiclessummary/{dateperiod}: get: tags: - ResourceOwnerReports summary: Get vehicles summary report description: Only vehicles that the user is associated with will be returned by this operation. 400 bad request is returend if the date period parameter is not in a correct format operationId: GetVehiclesSummaryReport parameters: - in: path name: dateperiod description: Date period parameter, in the form of only year (2014), year and month (201401), or interval {201301-201401} required: true schema: type: string responses: '200': description: The vehicles summary report is returned content: text/plain: schema: $ref: '#/components/schemas/VehiclesSummaryModel' application/json: schema: $ref: '#/components/schemas/VehiclesSummaryModel' text/json: schema: $ref: '#/components/schemas/VehiclesSummaryModel' '500': description: Internal server error '400': description: Bad request, date period is not in a correct format security: - oauth2: [] /v1/resourceowner/reports/emailtripreport: post: tags: - ResourceOwnerReports summary: Email a trip journal report to a desired email address description: Only vehicles that the user is associated will be allowed operationId: EmailTripReport responses: '200': description: Email with trip journal has been sent '500': description: Internal server error '404': description: ISO 639 language code does not exist '403': description: Not allowed to vehicle security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/EmailTripReportModel' text/json: schema: $ref: '#/components/schemas/EmailTripReportModel' application/*+json: schema: $ref: '#/components/schemas/EmailTripReportModel' description: The company model /v1/resourceowner/reports/emailtripreport/periods: get: tags: - ResourceOwnerReports summary: Get available vehicles and periods for an email trip journal operationId: EmailTripReportPeriods responses: '200': description: List with active vehicles and available month to send in email trip journal for is returned content: text/plain: schema: $ref: '#/components/schemas/EmailTripReportPeriodListModel' application/json: schema: $ref: '#/components/schemas/EmailTripReportPeriodListModel' text/json: schema: $ref: '#/components/schemas/EmailTripReportPeriodListModel' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/reports/geofencelog: get: tags: - ResourceOwnerReports summary: Get geofence log operationId: GetGeofenceLog parameters: - in: query name: vehicleId description: '' schema: type: integer format: int32 - in: query name: geofenceId description: '' schema: type: integer format: int32 - in: query name: fromDate description: '' schema: type: string format: date-time - in: query name: toDate description: '' schema: type: string format: date-time responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/GeofenceReportModel' application/json: schema: $ref: '#/components/schemas/GeofenceReportModel' text/json: schema: $ref: '#/components/schemas/GeofenceReportModel' security: - oauth2: [] x-summary-source: derived /v1/resourceowner/reports/exporttrips: get: tags: - ResourceOwnerReports summary: Export trips to Excel or PDF description: Only trips that the user is associated with will be returned by this operation. operationId: ExportTrips parameters: - in: query name: fromDate description: From date schema: type: string format: date-time - in: query name: toDate description: To date schema: type: string format: date-time - in: query name: reportType description: Excel or PDF schema: type: integer format: int32 enum: - 0 - 1 - 2 - in: query name: apiTripType description: Filter on trip type schema: type: integer format: int32 enum: - 0 - 1 - 2 - 3 - in: query name: vehicleId description: Filter on vehicle schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/HttpResponseMessage' application/json: schema: $ref: '#/components/schemas/HttpResponseMessage' text/json: schema: $ref: '#/components/schemas/HttpResponseMessage' security: - oauth2: [] components: schemas: TripsReportResponse: type: object properties: Request: $ref: '#/components/schemas/TripsReportRequestModel' TripsReport: type: array items: $ref: '#/components/schemas/TripsReportModel' additionalProperties: false VehiclesSummaryReportModel: type: object properties: VehiclesSummary: type: array items: $ref: '#/components/schemas/VehicleSummaryReportModel' Page: format: int32 type: integer Records: format: int32 type: integer TotalRecords: format: int32 type: integer PageSize: format: int32 type: integer additionalProperties: false ApprovedTripsSummaryResponse: type: object properties: approved: description: Whether all trip types configured for approval are approved for the period. type: boolean businessDistance: format: double description: Business distance in kilometers. type: number privateDistance: format: double description: Private distance in kilometers. type: number periodStartOdometer: format: double description: Calculated odometer at the beginning of the period, in kilometers. type: number periodEndOdometer: format: double description: Calculated odometer at the end of the period, in kilometers. type: number businessTollPassages: format: int32 description: Number of business toll passages. type: integer businessTollCost: format: double description: Total cost of business toll passages. type: number privateTollPassages: format: int32 description: Number of private toll passages. type: integer privateTollCost: format: double description: Total cost of private toll passages. type: number additionalProperties: false VehicleSummaryModel: type: object properties: DistanceReports: type: array items: $ref: '#/components/schemas/DistanceReportModel' FuelReports: type: array items: $ref: '#/components/schemas/FuelReportModel' TravelTimeReports: type: array items: $ref: '#/components/schemas/TravelTimeReportModel' CO2Reports: type: array items: $ref: '#/components/schemas/CO2ReportModel' IdleTimeReports: type: array items: $ref: '#/components/schemas/IdleTimeReportModel' VehicleId: format: int32 type: integer additionalProperties: false HttpResponseMessage: type: object properties: Version: $ref: '#/components/schemas/Version' Content: $ref: '#/components/schemas/HttpContent' StatusCode: format: int32 enum: - 100 - 101 - 102 - 103 - 200 - 201 - 202 - 203 - 204 - 205 - 206 - 207 - 208 - 226 - 300 - 301 - 302 - 303 - 304 - 305 - 306 - 307 - 308 - 400 - 401 - 402 - 403 - 404 - 405 - 406 - 407 - 408 - 409 - 410 - 411 - 412 - 413 - 414 - 415 - 416 - 417 - 421 - 422 - 423 - 424 - 426 - 428 - 429 - 431 - 451 - 500 - 501 - 502 - 503 - 504 - 505 - 506 - 507 - 508 - 510 - 511 type: integer ReasonPhrase: type: string Headers: type: array items: $ref: '#/components/schemas/StringStringIEnumerableKeyValuePair' readOnly: true TrailingHeaders: type: array items: $ref: '#/components/schemas/StringStringIEnumerableKeyValuePair' readOnly: true RequestMessage: $ref: '#/components/schemas/HttpRequestMessage' IsSuccessStatusCode: type: boolean readOnly: true additionalProperties: false FuelReportModel: type: object properties: Period: format: int32 type: integer BusinessFuelInLiters: format: double type: number PersonalFuelInLiters: format: double type: number OtherFuelInLiters: format: double type: number additionalProperties: false CO2ReportModel: type: object properties: Period: format: int32 type: integer BusinessCO2InGrams: format: double type: number PersonalCO2InGrams: format: double type: number OtherCO2InGrams: format: double type: number additionalProperties: false VehicleTinyModel: type: object properties: VehicleId: format: int32 type: integer NumberPlate: type: string Make: type: string Model: type: string FriendlyName: type: string FuelType: format: int32 enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 type: integer ModelYear: format: int32 type: integer ImageUrlMake: type: string UserFriendlyName: type: string additionalProperties: false StringStringIEnumerableKeyValuePair: type: object properties: Key: type: string Value: type: array items: type: string additionalProperties: false TripsReportModel: type: object properties: VehicleId: format: int32 type: integer StartDateTime: format: date-time description: UTC type: string StartTimezone: format: int32 type: integer EndDateTime: format: date-time description: UTC type: string EndTimezone: format: int32 type: integer StartOdometer: format: int32 description: Kilometers type: integer EndOdometer: format: int32 description: Kilometers type: integer StartAddressName: type: string EndAddressName: type: string Distance: format: double description: Kilometers type: number ParkedForMinUntilNextTrip: format: int32 type: integer FuelConsumption: format: double description: Liters type: number Co2Emissions: format: double description: Grams type: number IdleTime: format: int32 description: Seconds type: integer Notes: type: string TripType: format: int32 type: integer TripId: format: int64 type: integer Settings: format: int64 type: integer DriverContactId: format: int32 type: integer LicensePlate: type: string VehicleName: type: string additionalProperties: false Version: type: object properties: Major: format: int32 type: integer readOnly: true Minor: format: int32 type: integer readOnly: true Build: format: int32 type: integer readOnly: true Revision: format: int32 type: integer readOnly: true MajorRevision: format: int32 type: integer readOnly: true MinorRevision: format: int32 type: integer readOnly: true additionalProperties: false EmailTripReportPeriodModel: type: object properties: VehicleId: format: int32 type: integer FromDateMonth: format: int32 type: integer FromDateYear: format: int32 type: integer additionalProperties: false HttpMethod: type: object properties: Method: type: string additionalProperties: false GeofenceReportModel: type: object properties: FromDate: format: date-time type: string ToDate: format: date-time type: string VehicleId: format: int32 type: integer GeofenceId: format: int32 type: integer Result: type: array items: $ref: '#/components/schemas/GeofenceRecordReportModel' additionalProperties: false VehiclesSummaryModel: type: object properties: DistanceReports: type: array items: $ref: '#/components/schemas/DistanceReportModel' FuelReports: type: array items: $ref: '#/components/schemas/FuelReportModel' TravelTimeReports: type: array items: $ref: '#/components/schemas/TravelTimeReportModel' CO2Reports: type: array items: $ref: '#/components/schemas/CO2ReportModel' IdleTimeReports: type: array items: $ref: '#/components/schemas/IdleTimeReportModel' additionalProperties: false IdleTimeReportModel: type: object properties: Period: format: int32 type: integer BusinessIdleTimeInMinutes: format: int32 type: integer PersonalIdleTimeInMinutes: format: int32 type: integer OtherIdleTimeInMinutes: format: int32 type: integer additionalProperties: false TravelTimeReportModel: type: object properties: Period: format: int32 type: integer BusinessTravelTimeInMinutes: format: int32 type: integer PersonalTravelTimeInMinutes: format: int32 type: integer OtherTravelTimeInMinutes: format: int32 type: integer additionalProperties: false GeofenceRecordReportModel: type: object properties: TripId: format: int32 type: integer GeofenceId: format: int32 type: integer GeofenceName: type: string GeofenceType: format: int32 enum: - 0 - 1 - 2 type: integer IsInside: type: boolean EventDateTime: format: date-time type: string VehicleTinyModel: $ref: '#/components/schemas/VehicleTinyModel' additionalProperties: false HttpContent: type: object properties: Headers: type: array items: $ref: '#/components/schemas/StringStringIEnumerableKeyValuePair' readOnly: true additionalProperties: false EmailTripReportPeriodListModel: type: object properties: PeriodList: type: array items: $ref: '#/components/schemas/EmailTripReportPeriodModel' additionalProperties: false TripsReportRequestModel: type: object properties: VehicleIds: description: Optional type: array items: format: int32 type: integer FromDate: format: date-time description: UTC type: string ToDate: format: date-time description: UTC type: string additionalProperties: false HttpRequestMessage: type: object properties: Version: $ref: '#/components/schemas/Version' VersionPolicy: format: int32 enum: - 0 - 1 - 2 type: integer Content: $ref: '#/components/schemas/HttpContent' Method: $ref: '#/components/schemas/HttpMethod' RequestUri: format: uri type: string Headers: type: array items: $ref: '#/components/schemas/StringStringIEnumerableKeyValuePair' readOnly: true Properties: type: object additionalProperties: {} readOnly: true Options: type: object additionalProperties: {} readOnly: true additionalProperties: false TripSummaryReportModel: type: object properties: ReportStartPeriod: format: int32 type: integer ReportEndPeriod: format: int32 type: integer VehicleId: format: int32 type: integer TripType: format: int32 enum: - 0 - 1 - 2 type: integer DistanceInKilometers: format: double type: number TravelTimeInMinutes: format: int32 type: integer FuelInLiters: format: double type: number NumberOfTrips: format: int32 type: integer additionalProperties: false EmailTripReportModel: type: object properties: VehicleId: format: int32 type: integer Period: format: int32 type: integer ToEmail: type: string ISO639LanguageCode: type: string ExcludeDetailsForPersonalTrips: type: boolean ExcludeEnvironmentalAndFuelData: type: boolean additionalProperties: false VehicleSummaryReportModel: type: object properties: VehicleId: format: int32 type: integer VehicleIdentificationNumber: type: string NumberPlate: type: string Make: type: string Model: type: string ModelYear: format: int32 type: integer Business: format: double type: number Private: format: double type: number Other: format: double type: number Total: format: double type: number PeriodStartOdometer: format: double type: number PeriodEndOdometer: format: double type: number FuelConsumptionBusiness: format: double type: number FuelConsumptionPrivate: format: double type: number FuelConsumptionTotal: format: double type: number BusinessTolls: format: double type: number PrivateTolls: format: double type: number OtherTolls: format: double type: number NumberOfBusinessTolls: format: int32 type: integer NumberOfPrivateTolls: format: int32 type: integer NumberOfOtherTolls: format: int32 type: integer NumberOfTolls: format: int32 type: integer additionalProperties: false DistanceReportModel: type: object properties: Period: format: int32 type: integer BusinessDistanceInKilometers: format: double type: number PersonalDistanceInKilometers: format: double type: number OtherDistanceInKilometers: format: double type: number additionalProperties: false securitySchemes: oauth2: type: oauth2 flows: implicit: scopes: read: Read access to protected resources write: Write access to protected resources authorizationUrl: https://api.automile.com/login/ description: OAuth2 Implicit Grant x-provenance: method: harvested publisher: Automileab source: https://api.automile.com/swagger/v1/swagger.json note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json); stamped by stamp-openapi-provenance.py (roadmap#793)