How to preview an image Attachment in a Task if an Attachment is added via API

When I add an image Attachment to a Task via web UI on Asana task, the Attachment is shown as an image in among comments, so I see the preview of this image.

However if I add an image Attachment via Rest API, it is shown as clickable div, and if to click on it the image will be downloaded.

What is happening? What flag has to be set to see or preview an image Attachment as picture among other Task comments?

8 Likes

Im having the same problem and looking for answers here. Anyone know?

1 Like

Same here. Seems strange this is not possible? Anyone find a solution to this?

@Bastien_Siebman, am I remembering correctly that you have some experience with this question/topic?

I did try to upload attachments through the API, I struggled so much I don’t even remember if I succeeded and how :sweat_smile: sorry I can’t help…

1 Like

@Daniel_Hesketh - Check that you are providing the correct content type for the attachment.
You can do this by setting the Content-Type header when posting the attachment.

There are a list of MIME types for different image formats on MDN if you need them:

1 Like