openapi: 3.2.0 info: title: Automile Resource Owner Trip Approval V2 API version: v1 tags: - name: ResourceOwnerTripApprovalV2 paths: /v1/resourceowner/tripapproval/unsubmitted/{vehicleId}: get: tags: - ResourceOwnerTripApprovalV2 summary: List all trips which you as a user may submit for approval description: Only returns tracked assets that the user have access to operationId: ResourceOwnerTripApprovalController_GetUnsubmittedTripList parameters: - in: path name: vehicleId description: Show only trips for this vehicleId required: true schema: type: integer format: int32 - in: query name: from description: Show only trips from this date (default = 30 days back) schema: type: string format: date-time - in: query name: to description: Show only trips to this date, including the date (default = today) schema: type: string format: date-time - in: query name: tripType description: Show only trips with this category. 0 = Business, 2 = Other. (default = any type) schema: type: integer format: int32 enum: - 0 - 1 - 2 - 3 responses: '200': description: The list of trips is returned content: text/plain: schema: type: array items: $ref: '#/components/schemas/TripModelGET' application/json: schema: type: array items: $ref: '#/components/schemas/TripModelGET' text/json: schema: type: array items: $ref: '#/components/schemas/TripModelGET' '403': description: Missing permission to access vehicle '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/tripapproval/submit: post: tags: - ResourceOwnerTripApprovalV2 summary: Submit trips for approval operationId: ResourceOwnerTripApprovalController_SubmitTripList responses: '200': description: Success content: text/plain: schema: type: array items: $ref: '#/components/schemas/TripModelGET' application/json: schema: type: array items: $ref: '#/components/schemas/TripModelGET' text/json: schema: type: array items: $ref: '#/components/schemas/TripModelGET' '201': description: Request successfully created '403': description: Forbidden access to resource '500': description: Internal server error security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/TripApprovalSubmitModelPOST' text/json: schema: $ref: '#/components/schemas/TripApprovalSubmitModelPOST' application/*+json: schema: $ref: '#/components/schemas/TripApprovalSubmitModelPOST' description: Trip approval request information /v1/resourceowner/tripapproval/request/{tripApprovalRequestId}: get: tags: - ResourceOwnerTripApprovalV2 summary: Get a trip approval request operationId: ResourceOwnerTripApprovalController_GetTripApprovalRequest parameters: - in: path name: tripApprovalRequestId description: Trip approval request id required: true schema: type: integer format: int32 responses: '200': description: The trip approval request is returned content: text/plain: schema: $ref: '#/components/schemas/TripApprovalRequestModelGET' application/json: schema: $ref: '#/components/schemas/TripApprovalRequestModelGET' text/json: schema: $ref: '#/components/schemas/TripApprovalRequestModelGET' '403': description: No access to request '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/tripapproval/request: get: tags: - ResourceOwnerTripApprovalV2 summary: List all requests for trip approval which is submitted operationId: ResourceOwnerTripApprovalController_GetSubmittedTripApprovalRequestList parameters: - in: query name: from description: Show only requests submited from this date (default = 30 days back) schema: type: string format: date-time - in: query name: to description: Show only requests submited to this date (default = today) schema: type: string format: date-time - in: query name: vehicleId description: Show only trips for this vehicleId (default = all vehicles submitted for) schema: type: integer format: int32 - in: query name: statusType description: Status on request, SentForApproval = 0, Declined = 1, Approved = 2 (default = any status) schema: type: integer format: int32 enum: - 0 - 1 - 2 - 3 responses: '200': description: The submitted requests are returned content: text/plain: schema: type: array items: $ref: '#/components/schemas/TripApprovalRequestModelGET' application/json: schema: type: array items: $ref: '#/components/schemas/TripApprovalRequestModelGET' text/json: schema: type: array items: $ref: '#/components/schemas/TripApprovalRequestModelGET' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/tripapproval/{tripApprovalRequestId}/response: put: tags: - ResourceOwnerTripApprovalV2 summary: Approve or decline a trip approval request operationId: ResourceOwnerTripApprovalController_Response parameters: - in: path name: tripApprovalRequestId description: Trip approval request id to approve required: true schema: type: integer format: int32 responses: '200': description: The response has been successfully stored '500': description: Internal server error security: - oauth2: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/TripApprovalResponseModel' text/json: schema: $ref: '#/components/schemas/TripApprovalResponseModel' application/*+json: schema: $ref: '#/components/schemas/TripApprovalResponseModel' description: Approval information /v1/resourceowner/tripapproval/{tripApprovalRequestId}/revoke: put: tags: - ResourceOwnerTripApprovalV2 summary: Revoke a trip approval request description: Only allowed by the user who requested the approval and if no one has approved/declined the request operationId: ResourceOwnerTripApprovalController_RevokeRequest parameters: - in: path name: tripApprovalRequestId description: Trip approval request id to decline required: true schema: type: integer format: int32 responses: '200': description: The request has been successfully revoked '500': description: Internal server error security: - oauth2: [] components: schemas: TripApprovalResponseModel: type: object properties: Note: type: string Approved: type: boolean additionalProperties: false TripApprovalRequestModelGET: type: object properties: TripApprovalRequestId: format: int32 type: integer SubmitDateTime: format: date-time type: string SubmitterContactId: format: int32 type: integer SubmitterProfileImage: type: string SubmitterFullName: type: string FromUtc: format: date-time type: string ToUtc: format: date-time type: string NrOfTrips: format: int32 type: integer VehicleId: format: int32 type: integer VehicleName: type: string TotalDistanceInKilometer: format: double type: number TotalDuration: $ref: '#/components/schemas/TimeSpan' Status: format: int32 enum: - 0 - 1 - 2 - 3 type: integer StatusList: type: array items: $ref: '#/components/schemas/TripApprovalStatusModel' additionalProperties: false TripModelGET: type: object properties: TripId: format: int32 type: integer Category: format: int32 enum: - 0 - 1 - 2 - 3 type: integer TripStartDateTime: format: date-time type: string TripEndDateTime: format: date-time type: string TripStartAddress: type: string TripEndAddress: type: string VehicleName: type: string DistanceInKilometer: format: double type: number Duration: $ref: '#/components/schemas/TimeSpan' Note: type: string additionalProperties: false TripApprovalStatusModel: type: object properties: Status: format: int32 enum: - 0 - 1 - 2 - 3 type: integer ApproverFullName: type: string additionalProperties: false TripApprovalSubmitModelPOST: type: object properties: From: format: date-time type: string To: format: date-time type: string TripIdList: type: array items: format: int32 type: integer additionalProperties: false TimeSpan: type: object properties: Ticks: format: int64 type: integer Days: format: int32 type: integer readOnly: true Hours: format: int32 type: integer readOnly: true Milliseconds: format: int32 type: integer readOnly: true Microseconds: format: int32 type: integer readOnly: true Nanoseconds: format: int32 type: integer readOnly: true Minutes: format: int32 type: integer readOnly: true Seconds: format: int32 type: integer readOnly: true TotalDays: format: double type: number readOnly: true TotalHours: format: double type: number readOnly: true TotalMilliseconds: format: double type: number readOnly: true TotalMicroseconds: format: double type: number readOnly: true TotalNanoseconds: format: double type: number readOnly: true TotalMinutes: format: double type: number readOnly: true TotalSeconds: format: double type: number readOnly: true 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)