- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 02:28 AM
Hi,
I am configuring sending attachments from Incident (ServiceNow) to Other ServiceNow instances using the custom app. I configured the below script in BR. But it is always failing with 401 errors. (As below)
{"error":{"message":"Invalid file type: application/json","detail":null},"status":"failure"}
------------------------BR Script-------------------
Solved! Go to Solution.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-26-2025 01:24 AM
did you check the links I shared yesterday?
Unable to send attachment via REST
Business rule to send attachment to 3rd Party Tool via REST
Send attachment via rest message
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-26-2025 05:38 AM
Thanks All,
We are missing adding these parameters in the rest endpoint. (highlighted in red). Only sent over BR but missed adding in the end point. It's working now.
https://******.service-now.com/api/now/attachment/file?table_name=${table_name}&table_sys_id=${table_sys_id}&file_name=${file_name}
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 03:10 AM
401 means authentication issue.
Did you check that?
Post that check please see if your script fails and add logs to debug further.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 03:25 AM
Hi Ankur,
Sorry, its 400 error. Passing content type from attachment table but still error.
: {"error":{"message":"Invalid file type: image/jpeg","detail":null},"status":"failure"}
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 03:39 AM
are you sure the target instance has allowed to add image/jpeg on your record?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 04:20 AM
Yes, it's allowed.
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
‎02-25-2025 04:31 AM
check these links
Unable to send attachment via REST
Business rule to send attachment to 3rd Party Tool via REST
Send attachment via rest message
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
