Vehicle - Attachments
The Admin interface handles web service calls from the Admin web gui. The base url for this is at:
/api/vehicle-admin
A JSON file with OpenAPI data about all vehicle-related admin APIs can be downloaded here
.
Get Attachment
Get a specific attachment file as a download:
- GET /v1/attachments/{id}
Gets a specific attachment file as download
- Parameters
id (string) – The guid of the attachment to download
- Status Codes
200 OK – Success
- DELETE /v1/attachments/{id}
Marks a specified attachment as deleted and removes related data
- Parameters
id (string) – The guid of the attachment to delete
- Status Codes
200 OK – Success
If there is an attachment corresponding to the guid
provided in the request, an HTTP download will be returned:
"/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhp..."
Errors will return a 404 Not Found response.
Add new attachment file
Updates the information for an attachment file:
With a request body like this:
{
Attachment: "base64-encoded content of the file", // String
AttachmentName: "Attachment name", // String
AttachmentMimeType: "application/pdf", // String
AttachmentType: 0 // Int
}
Values of the AttachmentType
proprety can be one of the AttachmentType enumeration.
If the request is successful, it will return a Json positive response with the guid of the new record:
{
Guid: "53155c4a-b2a0-412f-ab41-552d9ccdf784" // Guid
}
or a plain Json negative response if there was an error saving the data.
Possible errors are described by these messages:
err_NoAttachment
Any of the required fields is empty or null
Delete attachment
Marks a specified attachment as deleted and removes related data:
- GET /v1/attachments/{id}
Gets a specific attachment file as download
- Parameters
id (string) – The guid of the attachment to download
- Status Codes
200 OK – Success
- DELETE /v1/attachments/{id}
Marks a specified attachment as deleted and removes related data
- Parameters
id (string) – The guid of the attachment to delete
- Status Codes
200 OK – Success
The corresponding record will be marked as deleted and it will return a plain Json positive response if successful, or a Json negative response with no additional data if not.