Attachments
Request accessWhat are attachments?
You can add files to a feedback you created, for example a photo of a missing road sign, a screenshot, or a short note. Attachments are optional. A feedback works exactly as before if you do not add any.
The files themselves are not sent through the Map Feedback API. Instead, the API gives you a temporary link to TomTom’s file storage, and your application uploads to and downloads from that link directly.
How to add an attachment
Adding an attachment takes three calls:
An attachment only counts as added once step 3 succeeds. If you stop after step 1 or step 2, the attachment stays unfinished and is never shown with the feedback.
Example of step 2
curl -X PUT "{uploadUrl}" \ -H "x-ms-blob-type: BlockBlob" \ -H "Content-Type: image/png" \ --data-binary "@missing-road-sign.png"The Content-Type you send here must be the same one you declared in step 1. The x-ms-blob-type
header is required by the storage service.
The upload and download links point at TomTom’s file storage on *.blob.core.windows.net. If your
network restricts outgoing traffic, allow that domain.
How to read an attachment back
The feedback itself lists its attachments. When you call
Get feedback by feedback ID or
Get feedback by reference ID,
the response contains an attachments list with the file name, type, size and creation date of every
attachment. The files themselves are not included.
To read the file, call
Get attachment download URL.
It returns a temporary download link that you can use with an HTTP GET request.
Virus scanning
Every uploaded file is scanned for malware before it can be downloaded. Because of this, a download link is not always available straight away:
- While the scan is still running, the call succeeds but returns no link and reports the state
PENDING. Wait a moment and try again. - Once the file is found to be safe, the call returns the download link and the state
CLEAN. - If the file is found to be harmful, it is never handed out. The call fails with the HTTP code
409.
How to remove an attachment
If you uploaded the wrong file, or the file has to be removed for privacy reasons, call Delete attachment. The file is deleted and the attachment is no longer listed with the feedback. This cannot be undone.
Limits
Limit | Value |
|---|---|
File types |
|
File size | 10 MiB (10,485,760 bytes) per file |
Attachments per feedback | 100 |
Validity of an upload or download link | 15 minutes. After that, ask for a new one. |