Vehicle - Attachments ===================== .. Last update: 08/11/2021 The base url for the APIs in this page is at:: /api/vehicle-mobile A JSON file with OpenAPI data about all vehicle-related mobile APIs can be downloaded :download:`here `. Get an attachment ----------------- .. openapi:: /openapi/srv-vehicle/api-src-WebMobile.json :paths: /v1/attachment/{id} Used to retrieve the specified attachment. The response will be negative if no attachment is found for the specified guid, or with the attachment if the trip is found. The resulting response is a File object. Add attachment to damage ------------------------ .. openapi:: /openapi/srv-vehicle/api-src-WebMobile.json :paths: /v1/attachment/damage/{id} Used to add an attachment to the specified damage report. The response will be negative if no report is found for the specified id, or positive when the attachment is correctly stored. With a request body like this:: { Data: "base64-encoded content of the file", // String Name: "Attachment name", // String MimeType: "application/pdf" // String } This API is deprecated, use sync damage reports' attachment instead Sync Damage Reports' Attachments -------------------------------- Receives data about multiple attachments related to damage reports .. openapi:: /openapi/srv-vehicle/api-src-WebMobile.json :paths: /v1/attachment/damage/sync The body of the request is the following:: { Attachments: [ { DamageReport: 'ce8bb2da-8047-44e3-9f0d-80e792f4f90e', // Guid of the damage report related to the attachment Guid: '91cd7750-44dc-41ca-b6cd-b801a6cca9ec', // Guid Data: "base64-encoded content of the file", // String Name: "Attachment name", // String MimeType: "application/pdf" // String }, { ... } ] } In case of problems while registering one or more attachments, the API will return an OK response with the details of the attachments with errors:: { [ { Attachment: "91cd7750-44dc-41ca-b6cd-b801a6cca9ec", // Guid of the attachment Code: "10101", // Numeric code of the error Message: "..." // Localized description of the error }, { ... } ] } The error reason may be: * 00100: some error arose while trying to save the attachment in the storage * 00101: no damage report has been found for the provided guid