Vehicle - Attachments
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 here
.
Get an attachment
- GET /v1/attachment/{id}
Gets a specific attachment file as download
- Parameters
id (string) – The guid of the attachment to download
- Status Codes
200 OK – Success
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
- POST /v1/attachment/damage/{id}
Receives the value for a damage report attachment
- Parameters
id (integer) – The id of the damage report to append this attachment to
- Status Codes
200 OK – Success
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
- POST /v1/attachment/damage/sync
Synchronizes the list of attachment for the damage reports from the client to the server
- Status Codes
200 OK – Success
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