Core - Attachments
Module dedicated to handling attachments.
The base url for the APIs in this page is at:
/api/mobile/
A JSON file with OpenAPI data about all core-related mobile APIs can be downloaded here
.
Gets a specific attachment file as download
- 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
The answer will be an HTTP download like this:
/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQA...
The result can be also a negative response with one of these messages:
No data found for file ...
No data found.
Unable to serve data at ...
Generic error.
Or a “Not Found” error.
Sync License Document’s Attachments
Receives data about multiple attachments related to the user’s last license document
- POST /v1/attachment/license-document/sync
Synchronizes the list of attachment for a license document from the client to the server
- Status Codes
200 OK – Success
The body of the request is the following:
{
Attachments: [
{
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