I need to create tickets via the API that include inline images originally in an email. I do not just want them only as attachments - I need to view them inline in the ticket body. Otherwise, there is little point as it just makes reading the message difficult.
I have tried a number of things with no success:
1.) I replace <img src=”cid:somefile.png@1234”/> with <img src=”somefile.png”/> and adding a “somefile.png” attachment to the CreateTicket api. It appends the attachment but does not render inline.
2. I have replaced <img src=”cid:somefile.png@1234”/> with <img src="data:image/jpeg;charset=utf-8;base64,/9j/4AAQSkAUUUxxxUAf/2Q=="/> to inline the image as Base64 and entirely avoid attachments altogether. The system strips this out and renders it as <img/>
If I create a ticket via the UI or even add a note I get the behavior I want which is something like this: <img src="https://attachment.freshdesk.com/inline/attachment?token=xxxxxxxxx" data-id="153010400494"> How do I achieve this via the API?
I appreciate any assistance.
Page 1 / 1
My team is experiencing the same challenge.
Facing the same issue. Hope developers look into this as soon as possible
Hi @GLFJ. Greetings. Thanks for reaching Freshworks community.
I understand that you would like to include inline images in the ticket. You should be able to do so via API within the description tag as shown below.
Can you confirm if we tried passing it in the description tags as shown above? Please ensure that the image is hosted in a public location.
Kindly try and please keep us posted with the result.
Cheers, Sujitha Dhanaseelan. Learn something new today, get recognized for your contributions, stay on top of product updates and build meaningful connections in our Freshdesk community. Fresh ideas, quality service.
The whole point is that I do not want to put images on an external site. I want to attach them to the posting or inline as described. Same behavior as if I had the system monitor a mailbox directly.
I found this discussion from a few years ago where it is confirmed that removal of base64 encoded images is intentional.
The boogeyman of security is blamed, but I think the mailbox monitor happily processes base64 and CID images. It’s a shame that the API isn’t capable of providing comparable functionality.
I know this is an old thread but the way I’ve gotten around this is by creating a draft Solution Article as an image store, adding all of my images to that and then I can just get internally stored images and embed them elsewhere as I please. It’s not pretty but it works.
Is the draft solution visible to users. Support had suggested creating a KB article to host the images, but I didn’t want users to be able to browse into that article and see everything.
The workaround I used was to upload the images as attachments to notes. After the ticket was created, the inline images would be uploaded to a public or private note and then the actual notes that needed to show the inline images referenced the attachment URLs. This resulted in one or two extra notes per ticket, but the agents didn’t mind. And it kept the security. If the note was private, then the images were stored in a private note so end users couldn’t find their way into them. And the images being associated with the ticket meant that the user had to have access to the ticket to see the images. And for the main ticket, the API allows editing of it. So, the main ticket would be created with placeholders for the inline images. Then after the images were uploaded, the main ticket was edited to replace the placeholders with the actual URLs. But if a draft solution is not visible to anyone, your solution would be cleaner.
Still, the best solution would be for Freshworks to update the API to properly support inline images.
Is the draft solution visible to users. Support had suggested creating a KB article to host the images, but I didn’t want users to be able to browse into that article and see everything.
No, Sir. It is a Draft article that just sits there getting images added to it, it isn’t published, thus not visible to users.
I have images posted inline in the article that I can then just copy the address and use where I please, lots of images used on our Portal are stored in this draft article. Works a treat until Freshservice actually add basic functionality like this, too focused on AI it seems.
EDIT: Just got a user to test and see if they can access the draft article with a direct link and as expected, they cannot access it. :)
Hope this helps.
I faced the same issue. Freshdesk doesn't support Base64 inline images via API. The solution that worked for me was to host the image online (like on Imgur or your own server) and then use an <img> tag in the description field, like this:
That way the image shows inline in the ticket body. Hope it helps!
Creating a ticket via the API with inline images allows users to submit rich, detailed support requests directly from apps or systems. This process typically involves first uploading the image to the support platform’s media endpoint, which returns a token or URL. That token is then referenced within the ticket’s HTML body using an <img> tag, enabling inline display of the image within the message content. This method enhances clarity in communication, especially for visual issues like bugs or UI errors, and provides support teams with the necessary context without needing to open separate attachments.