How to upload inline images when creating macros with the API | Community
Skip to main content

How to upload inline images when creating macros with the API

  • January 20, 2022
  • 1 reply
  • 0 views

Envoy-Data

I'm creating several hundred macros via the API.

I know how to create and associate macro attachments, but I'm a little less clear on how to attach inline images to a macro. 

I can use the standard ticket attachments endpoint to upload a file. In fact, it looks like this is what Zendesk does when you drag an image into the edit window of the create macro interface.

But I'm not sure how to associate the attachment with the macro after that.

Basically, I want to make sure that the inline images won't expire after 3 days. But I don't want the images to appear as downloadable attachments when the macro is applied to a comment.

1 reply

Tipene
  • January 26, 2022

Hi @envoy-data,

Thanks for reaching out!

Macros don’t have a way for specifying inline image attachments via API, unfortunately. One possible work around to this could be using dynamic content and specifying the image in markdown e.g:

![image.png]
(https://website.com/some_image.png)

You could then add a dynamic content placeholder in the comment body of the macro which would display the previously specified image as an inline attachment.

I hope this helps! Feel free to reach out with any questions.

Tipene