swagger: '2.0' info: title: Automile ClientApi ResourceOwnerIntegration API version: v1 tags: - name: ResourceOwnerIntegration paths: /v1/resourceowner/integration: get: tags: - ResourceOwnerIntegration summary: Integration Configuration description: '' operationId: ResourceOwnerIntegrationController_GetIntegrationConfiguration produces: - text/plain - application/json - text/json responses: '200': description: Successful retrieval of integration settings schema: $ref: '#/definitions/IntegrationConfigurationModel' '500': description: Internal server error security: - oauth2: [] put: tags: - ResourceOwnerIntegration summary: Update integration configuration description: If you want to update one integration but not the rest you can exclude them from the model. operationId: ResourceOwnerIntegrationController_UpdateIntegrationSettings consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: body name: body schema: $ref: '#/definitions/IntegrationConfigurationModel' responses: '200': description: Integration configuration successfully retrieved schema: $ref: '#/definitions/HttpResponseMessage' '403': description: User have no organization or is not authorized to this organization '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/alphabet: get: tags: - ResourceOwnerIntegration summary: Information description: Run this once before running Alphabet login. The flag LoginRequired will say if login to Alphabet is required to run (e.g. user has changed password in Alphabet) then this method should be run again after login. operationId: ResourceOwnerIntegrationController_GetAlphabetInformation produces: - text/plain - application/json - text/json responses: '200': description: List with active vehicles and available month to send in mileagelog report for is returned schema: $ref: '#/definitions/AlphabetInformationModel' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/alphabet/login: post: tags: - ResourceOwnerIntegration summary: Alphabet login description: This is only needed if Alphabet information returned the required login flag set to true. User credentials are stored for future requests. operationId: ResourceOwnerIntegrationController_AlphabetLogin produces: - text/plain - application/json - text/json parameters: - in: query name: username type: string - in: query name: password type: string responses: '200': description: Login succeeded schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Alphabet returned an error, this will usually be caused by entering wrong username or password '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/alphabet/mileagelog/{vehicleId}/{year}/{month}: get: tags: - ResourceOwnerIntegration summary: Get Alphabet mileage log description: Run this with vehicle id and period returned from Alphabet information. Data model contains odometer values and business km from the first day to the last day of sent in month. operationId: ResourceOwnerIntegrationController_GetAlphabetMileageLog produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 responses: '200': description: Mileage log data for previewing purpose is returned schema: $ref: '#/definitions/AlphabetMileageLogModel' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] post: tags: - ResourceOwnerIntegration summary: Send Alphabet mileage log description: GET must be run before POST operationId: ResourceOwnerIntegrationController_SendAlphabetMileageLog consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 - in: body name: body description: Model received from GET schema: $ref: '#/definitions/AlphabetMileageLogModel' responses: '200': description: Mileage log report was sent schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/autoplan: get: tags: - ResourceOwnerIntegration summary: "AutoPlan Information (Legacy)\r\nThis endpoint uses the old AutoPlan API which requires username/password authentication. Please migrate to the new /autoplan/v2/information endpoint which uses certificate-based authentication." description: Run this once before running AutoPlan login. The flag LoginRequired will say if login to AutoPlan is required to run (e.g. user has changed password in AutoPlan) then this method should be run again after login. operationId: ResourceOwnerIntegrationController_GetAutoplanInformation produces: - text/plain - application/json - text/json responses: '200': description: List with active vehicles and available month to send in mileagelog report for is returned schema: $ref: '#/definitions/AutoplanInformationModel' '500': description: Internal server error deprecated: true security: - oauth2: [] /v1/resourceowner/integration/autoplan/v2/information: post: tags: - ResourceOwnerIntegration summary: Get AutoPlan V2 Information description: Personal identity number must be provided in the request body. operationId: ResourceOwnerIntegrationController_GetAutoPlanV2Information consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: body name: body description: Request containing personal identity number (12 digits in format YYYYMMDDNNNN) schema: $ref: '#/definitions/AutoPlanV2InformationRequestModel' responses: '200': description: List of vehicles with available periods for driving journal and odometer readings schema: $ref: '#/definitions/AutoPlanV2InformationModel' '400': description: Invalid personal identity number '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/autoplan/login: post: tags: - ResourceOwnerIntegration summary: "AutoPlan login (Legacy)\r\nThis endpoint uses the old AutoPlan API which requires username/password authentication." description: This is only needed if AutoPlan wizard returned the required login flag set to true. User credentials are stored for future requests. operationId: ResourceOwnerIntegrationController_AutoplanLogin produces: - text/plain - application/json - text/json parameters: - in: query name: username type: string - in: query name: password type: string responses: '200': description: Login succeeded schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Autoplan returned an error, this will usually be caused by entering wrong username or password '500': description: Internal server error deprecated: true security: - oauth2: [] /v1/resourceowner/integration/autoplan/mileagelog/{vehicleId}/{year}/{month}: get: tags: - ResourceOwnerIntegration summary: Get AutoPlan mileage log (Legacy) description: Run this with vehicle id and period returned from Autoplan wizard. Data model contains odometer values and business km from the first day to the last day of sent in month. operationId: ResourceOwnerIntegrationController_GetAutoplanMileageLog produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 responses: '200': description: Mileage log data for previewing purpose is returned schema: $ref: '#/definitions/AutoplanMileageLogModel' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error deprecated: true security: - oauth2: [] post: tags: - ResourceOwnerIntegration summary: Send AutoPlan mileage log (Legacy) description: GET must be run before POST operationId: ResourceOwnerIntegrationController_SendAutoplanMileageLog consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 - in: body name: body description: Model received from GET schema: $ref: '#/definitions/AutoplanMileageLogModel' responses: '200': description: Mileage log report was sent schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error deprecated: true security: - oauth2: [] /v1/resourceowner/integration/autoplan/v2/drivingjournal/{vehicleId}/{year}/{month}: get: tags: - ResourceOwnerIntegration summary: Get AutoPlan V2 Driving Journal Preview description: Get driving journal data for preview before sending. Contains odometer values and business km for the specified period. This is the NEW API endpoint that replaces GET /autoplan/mileagelog (legacy). operationId: ResourceOwnerIntegrationController_GetAutoPlanV2DrivingJournal produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of the period required: true type: integer format: int32 - in: path name: month description: Month of the period required: true type: integer format: int32 responses: '200': description: Driving journal data for preview schema: $ref: '#/definitions/AutoPlanV2DrivingJournalModel' '400': description: Invalid parameters '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] post: tags: - ResourceOwnerIntegration summary: Send AutoPlan V2 Driving Journal description: 'Send driving journal to AutoPlan V2 API. GET endpoint must be called first to retrieve the data to send. Note: Incoming odometer is automatically calculated from previous period''s outgoing value per API specification. This is the NEW API endpoint that replaces POST /autoplan/mileagelog (legacy).' operationId: ResourceOwnerIntegrationController_SendAutoPlanV2DrivingJournal consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of the period required: true type: integer format: int32 - in: path name: month description: Month of the period required: true type: integer format: int32 - in: body name: body description: Request containing Personal identity number (12 digits YYYYMMDDNNNN format) and Driving journal data from GET endpoint schema: $ref: '#/definitions/AutoPlanV2SendDrivingJournalRequestModel' responses: '200': description: Driving journal successfully sent schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Invalid parameters or data mismatch '401': description: Not all trips in period are approved '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/bilreda: get: tags: - ResourceOwnerIntegration summary: Bilreda Information description: Currently in the period list the month previous to today will always have the selected flag set to true. operationId: ResourceOwnerIntegrationController_GetBilredaInformation produces: - text/plain - application/json - text/json responses: '200': description: Active vehicle with a list of available months to send in mileagelog report for is returned schema: $ref: '#/definitions/BilredaInformationModel' '400': description: User may not have activated any Bilreda integration '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/integration/bilreda/mileagelog/{vehicleId}/{year}/{month}: get: tags: - ResourceOwnerIntegration summary: Get Bilreda mileage log description: Run this with vehicle id and period returned from Bilreda wizard. Data model contains odometer values and business km from the first day to the last day of sent in month. operationId: ResourceOwnerIntegrationController_GetBilredaMileageLog produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 responses: '200': description: Mileage log data for previewing purpose is returned schema: $ref: '#/definitions/BilredaMileageLogModel' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] post: tags: - ResourceOwnerIntegration summary: Send Bilreda mileage log description: GET must be run before POST operationId: ResourceOwnerIntegrationController_SendBilredaMileageLog consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 - in: path name: year description: Year of from date in period required: true type: integer format: int32 - in: path name: month description: Month of from date in period required: true type: integer format: int32 - in: body name: body description: Model received from GET schema: $ref: '#/definitions/BilredaMileageLogModel' responses: '200': description: Mileage log report was sent schema: $ref: '#/definitions/HttpResponseMessage' '400': description: Invalid parameter values '403': description: You are not authorized to this vehicle '500': description: Internal server error security: - oauth2: [] definitions: AutoPlanV2InformationRequestModel: type: object properties: PersonalIdentityNumber: type: string additionalProperties: false StringStringIEnumerableKeyValuePair: type: object properties: Key: type: string Value: type: array items: type: string additionalProperties: false BilredaInformationModel: type: object properties: LoginIsRequired: type: boolean VehicleList: type: array items: $ref: '#/definitions/IntegrationVehicleModel' additionalProperties: false HttpContent: type: object properties: Headers: type: array items: $ref: '#/definitions/StringStringIEnumerableKeyValuePair' readOnly: true additionalProperties: false AutoPlanV2SendDrivingJournalRequestModel: type: object properties: PersonalIdentityNumber: type: string JournalData: $ref: '#/definitions/AutoPlanV2DrivingJournalModel' additionalProperties: false AutoPlanV2VehicleInfo: type: object properties: VehicleId: format: int32 type: integer FriendlyName: type: string NumberPlate: type: string IsVehicleApproved: type: boolean PeriodList: type: array items: $ref: '#/definitions/AutoPlanV2PeriodInfo' additionalProperties: false AutoPlanV2PeriodInfo: type: object properties: Year: format: int32 type: integer Month: format: int32 type: integer IsSelected: type: boolean additionalProperties: false AlphabetInformationModel: type: object properties: LoginIsRequired: type: boolean VehicleList: type: array items: $ref: '#/definitions/IntegrationVehicleModel' additionalProperties: false AutoplanInformationModel: type: object properties: LoginIsRequired: type: boolean VehicleList: type: array items: $ref: '#/definitions/IntegrationVehicleModel' additionalProperties: false IntegrationVehicleModel: type: object properties: FriendlyName: type: string NumberPlate: type: string VehicleId: format: int32 type: integer IsVehicleApproved: type: boolean PeriodList: type: array items: $ref: '#/definitions/IntegrationPeriodModel' additionalProperties: false BilredaMileageLogModel: type: object properties: StartOdometerKm: format: int32 type: integer EndOdometerKm: format: int32 type: integer BusinessKm: format: int32 type: integer IsApproved: type: boolean TotalKm: format: int32 type: integer readOnly: true OtherAndPrivateKm: format: int32 type: integer readOnly: true TollFeeBusiness: format: int32 type: integer additionalProperties: false AlphabetMileageLogModel: type: object properties: StartOdometerKm: format: int32 type: integer EndOdometerKm: format: int32 type: integer BusinessKm: format: int32 type: integer IsApproved: type: boolean TotalKm: format: int32 type: integer readOnly: true OtherAndPrivateKm: format: int32 type: integer readOnly: true additionalProperties: false HttpResponseMessage: type: object properties: Version: $ref: '#/definitions/Version' Content: $ref: '#/definitions/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: '#/definitions/StringStringIEnumerableKeyValuePair' readOnly: true TrailingHeaders: type: array items: $ref: '#/definitions/StringStringIEnumerableKeyValuePair' readOnly: true RequestMessage: $ref: '#/definitions/HttpRequestMessage' IsSuccessStatusCode: type: boolean readOnly: true additionalProperties: false IntegrationPeriodModel: type: object properties: Year: format: int32 type: integer Month: format: int32 type: integer IsSelected: type: boolean additionalProperties: false IntegrationConfigurationModel: type: object properties: AutoPlanActive: type: boolean AlphabetActive: type: boolean BilredaActive: type: boolean BilredaVehicleId: format: int32 type: integer additionalProperties: false HttpMethod: type: object properties: Method: type: string additionalProperties: false HttpRequestMessage: type: object properties: Version: $ref: '#/definitions/Version' VersionPolicy: format: int32 enum: - 0 - 1 - 2 type: integer Content: $ref: '#/definitions/HttpContent' Method: $ref: '#/definitions/HttpMethod' RequestUri: format: uri type: string Headers: type: array items: $ref: '#/definitions/StringStringIEnumerableKeyValuePair' readOnly: true Properties: type: object additionalProperties: {} readOnly: true Options: type: object additionalProperties: {} readOnly: true additionalProperties: false AutoPlanV2InformationModel: type: object properties: VehicleList: type: array items: $ref: '#/definitions/AutoPlanV2VehicleInfo' additionalProperties: false AutoplanMileageLogModel: type: object properties: StartOdometerKm: format: int32 type: integer EndOdometerKm: format: int32 type: integer BusinessKm: format: int32 type: integer IsApproved: type: boolean TotalKm: format: int32 type: integer readOnly: true OtherAndPrivateKm: format: int32 type: integer readOnly: true additionalProperties: false AutoPlanV2DrivingJournalModel: type: object properties: StartOdometerKm: format: int32 type: integer EndOdometerKm: format: int32 type: integer BusinessKm: format: int32 type: integer IsApproved: type: boolean 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 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