Attachments

Request access

Important note
This API is not available as part of our free evaluation or Pay As You Grow (PAYG) offering. Click the Request Access button above to contact our Sales team.

What 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:

1. Ask for an upload link
Call Initiate attachment upload with the file name, the file type and the file size. You get back an attachment ID and an upload link.

2. Upload the file
Send the file to the upload link with an HTTP PUT request. Use the link exactly as you received it, and do not add your API key to it.

3. Confirm the upload
Call Complete attachment upload. TomTom checks the uploaded file and, if everything matches, the attachment becomes part of the feedback.

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

put
Uploading the file to the upload link
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

image/png, image/jpeg, image/gif, image/webp, application/pdf, text/plain

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.