Error while calling the rest attachment API using POSTMAN. "message": "Failed to create the attachment. File part might be missing in the request."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2017 12:59 AM
Issue : Error while calling the rest attachment API using POSTMAN. "message": "Failed to create the attachment. File part might be missing in the request."
Error:
{
"error": {
"detail": null,
"message": "Failed to create the attachment. File part might be missing in the request."
},
"status": "failure"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2017 01:03 AM
Hi,
Please share the request body of it.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2018 06:26 AM
[{"key":"table_name","value":"incident","description":"","type":"text","enabled":true},{"key":"table_sys_id","value":"d4257ded4f301b00ba7653418110c77f","description":"","type":"text","enabled":true},{"key":"","value":{"0":{}},"description":"","type":"file","enabled":true}]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 07:33 AM
Hi Karan,
You need to pass the binary data as part of the file in your body request as there are only two ways to add an attachment to a record in ServiceNow through attachment API.
What you can do here is use the binary method to achieve it with POSTMAN.
At first, give it a shot with REST API Explorer, you won't feel the need of using POSTMAN at all.
Then use same request header and attach the file through postman. It should give you 201 status code.
Thanks
Gaurav