Using Attachment API - POST /now/attachment/file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 11:38 PM
Hi All,
I have been trying to consume the Attachment API available in the Geneva Release to be able to attach certain files (images,xls etc) to existing records on a table.Using the REST API Explorer, I was able to upload a file by providing the path in the 'Binary' tab.However, I am unaware as to how we could do the same through the Request Body while making the REST call.
I tried using parameter 'uploadFile' to provide the file path, just as we see in the snippet but instead it takes it as a text and creates an attachment.
I also tried passing the Base64 encoded string for an image but instead it creates a corrupted image attachment.
Kindly advise what I am missing here.
Thanks and Regards,
Preethi
Message was edited by: Preethi Premnath
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-31-2016 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 12:13 AM
Hi Prithviraj,
Thanks for your response.However, I need upload files from a location outside ServiceNow and then attach them to existing records on the instance.As I understand , to use the method setRequestBodyFromAttachment(), we require the attachment sys id which in my case wont work.
Regards,
Preethi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 12:55 AM
See if you find this thread helpful.
How to retrieve an attachment from service now via SOAP Web Service