Send attachment file via trigger JSON when a comment contains an attachment | Community
Skip to main content

Send attachment file via trigger JSON when a comment contains an attachment

  • May 4, 2022
  • 3 replies
  • 0 views

Luciano11

Hi there, I'm trying to integrate Zendesk and Service Now, but I'm not being able to send attachments properly.

I've configured a trigger to send a POST HTTP request to a SNow webhook whenever a comment is posted on a ticket. This is working fine.

Now, when trying to send attachments, it is not working. The Snow endpoint "/api/now/attachment/upload" requires a FORM submission instead of plain JSON, returning the error message "Invalid content-type. Supported request media types for this service are: [multipart/form-data]" when I send a payload like this:

{
    "file_name": "name_of_the_file.txt",
    "table_name": "incident",
    "table_sys_id": "..."
}

By using cURL, we can successfully send an attachment using a request like this

curl "https://my-snow-site.service-now.com/api/now/attachment/upload" \
--request POST \
--header "Accept:application/json" \
--user 'admin':'admin' \
--header "Content-Type:multipart/form-data" \
-F 'table_name=incident' -F 'table_sys_id=...' -F 'uploadFile=@<location of the file on file system>'

Is there any way to get a Zendesk trigger to post a form?
Thanks

3 replies

  • May 5, 2022
Hi Luciano,
 
In regards to this inquiry, Zendesk doesn't have an integration natively yet with Service Now. But looking online, there are third-party applications that you can use to integrate Zendesk with Service Now with complete functionality.
 
As for Zendesk to post a form via trigger, unfortunately, it can only send a link to the form not posting the form itself. 
 
Have a great day ahead!
 
 
 
Kind regards,

Luciano11
  • Author
  • May 5, 2022

After further testing with many tweaks, I've come to this same conclusion.

It seems that the whole point is that Zendesk trigger actions (configured via webhooks) cannot be set to post a form (setting the appropriate content-type), nor can post an attachment file, only the URL for the file hosted on Zendesk.

Thanks @dj11!


  • May 6, 2022
Hi Luciano,
 
Yes, unfortunately only the URL for the hosted form can be used on Zendesk. I would highly encourage you to post this as product feedback on one of our Community pages. You can check them here, for more information.
 
Have a wonderful day ahead! 
 
 
Kind regards,