Answered

Image upload with Rest API

  • 31 October 2023
  • 6 replies
  • 483 views

Hey there, I’m finding it difficult to understand the rest API docs around file uploads. I would love to have a user fill out a form, and attach an image, and this would be submitted by the API to create a ticket. I see that the “File” type is supported in the tickets, however I’m finding difficulty in figuring out what Intercom wants as a file

 

Is there any more documentation that you could point me towards? Or could you provide a quick example of what an image upload would look like with the API? 

 

Thanks, Aaron. 

icon

Best answer by cameron.gumley 2 November 2023, 08:00

View original

6 replies

Userlevel 3
Badge +3

Hi @Aaron Byrom -- Cam from the Intercom Support Engineering team here!

Appreciate your question and your feedback on the API docs, which I’ll pass along to our Product Management team 👍

Have you had a look at the details covered HERE in our Dev Docs (screenshot below as well👇)?

Let me know if this is helpful or if you’ve already looked through things there and things are still unclear. 

Hey,

I’m having the same issue. I created a ticket type that require a “attachment” field. This attachment field is of format “file upload”. When creating a new ticket, I tried to send the files as multipart/form-data or using the same format that on the ticket part on nothing is working.

How should I send files with the creation of a ticket through the API?

Userlevel 3
Badge +3

@Louis Demeslay -- Glad to help if this remains an open issue. Can you confirm - what value are you entering for the “type” attribute within the “attachments” array? Are you adding the string “file upload” as indicated in your above message, or are you using/have you tried just putting “upload”? 

Hey, I’m likewise unable to create a ticket via API and have it populate a field of type “file upload” (with single file uploads or allowing multiple file uploads).  I’ve tried sending an array of file URLs, an array of base64 strings of the file content, and an array of attachment objects of the form detailed earlier in this thread (matching the same format as what I see present if I do an API GET of an existing ticket with files uploaded to a file upload attribute through the Intercom UI).  If it’s possible for you to provide the format necessary to upload to a file upload attribute as part of ticket creation via API, then that would be helpful.  Thank you!

@Cam G. I have tried everything i can think of. Could you just provide an example with the expected format please?

@Cam G. we have the same issue. Any updates here?

Reply