Skip to main content
Question

Create a ticket via the API with inline images


Forum|alt.badge.img
  • Community Debut
  • 1 reply

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.

Did this topic help you find an answer to your question?

9 replies

Taylor G
Community Debut
  • Community Debut
  • 1 reply
  • July 24, 2024

My team is experiencing the same challenge.


iamvisu
Community Debut
  • Community Debut
  • 1 reply
  • July 24, 2024

Facing the same issue. 
Hope developers look into this as soon as possible 🙂


Sujitha Dhanaseelan
Community Manager
Forum|alt.badge.img+6

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.

 

"description":"Test Article <img src='https://snag.gy/0vVeuf.jpg' alt='Smiley face'>",

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.


Forum|alt.badge.img
  • Author
  • Community Debut
  • 1 reply
  • August 8, 2024

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.


  • Community Debut
  • 2 replies
  • August 14, 2024

I found this discussion from a few years ago where it is confirmed that removal of base64 encoded images is intentional. 

https://community.freshworks.dev/t/base64-inline-image-in-freshdesk-ticket-are-removed/3932

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.


Forum|alt.badge.img+5
  • Skilled Expert
  • 21 replies
  • March 13, 2025

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.


  • Community Debut
  • 2 replies
  • March 19, 2025

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. 


Forum|alt.badge.img+5
  • Skilled Expert
  • 21 replies
  • March 19, 2025
mkaec wrote:

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.


safron342
Community Debut
  • Community Debut
  • 1 reply
  • March 19, 2025

I understand the need for inline images in tickets, especially for gaming platforms like Stick War. Using attachments or a draft article to store images is a good workaround for now. Hopefully, Freshdesk updates the API to support inline images natively in the future!


Reply