- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 08:36 AM
Hi,
I am trying to use the REST Attachment API (/api/now/attachment/file) to add an attachment that is formatted as a Base64 string. I have put the string in the "Raw" section in the body, but it is just creating the file with the Base64 string in it.
Is there any way to make this work using a Base64 string?
Thanks!
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 01:46 PM
No, the REST Attachment API accepts attachments in binary or multipart format.
Attachment API - POST /now/attachment/upload
Binary: Attachment API - POST /now/attachment/file
Multipart : Attachment API - POST /now/attachment/upload
There is a SOAP endpoint that accepts Base 64.
Sending an attachment to ServiceNow via Web Services - ServiceNow Guru

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 01:46 PM
No, the REST Attachment API accepts attachments in binary or multipart format.
Attachment API - POST /now/attachment/upload
Binary: Attachment API - POST /now/attachment/file
Multipart : Attachment API - POST /now/attachment/upload
There is a SOAP endpoint that accepts Base 64.
Sending an attachment to ServiceNow via Web Services - ServiceNow Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 01:49 PM
Thank you Bryan!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 11:20 AM
Hi,
I was trying to do the same thing here. I used the Attachment API to post a binary file in the data of the POST request with content-type: "text/plain", and charset: 'utf-8'. I saved the file name with a .txt extension. I wanted to get the text file as the attachment but the content was in binary. Am I missing any conversion step/ having the wrong content-type set or is it not how the POST ATTACHMENT API's supposed to work?