Unable to send attachment using Postman using multipart/form-data

Suggy
Giga Sage

We are trying to send an attachment using multipart/form-data in postman and get this error:

{
"error": {
"message": "Failed to create the attachment. File part might be missing in the request.",
"detail": null
},
"status": "failure"
}

 

The same is working from ServiceNow REST API explorer.

 

I have seen similar post since 2015 but no correct answers till now 🙂

 

 

1 ACCEPTED SOLUTION

Note: I have done entirely on my instance.....

 

So, I have reproduce your steps in my instance. 

I think you should also follow the same, I guess the version of POSTMAN you are using is not current version so just upgrade it or use the current version of Postman here is the steps that I followed.

 

Inside Body ---> Form-data ---> file (File) type.....

Authentication used : Basic 

 

Also no need to configure Header in this case rather 

 

Inside Authorization.... 

 

authorization postman.PNG

Step 1: 

saurabh_dubey_1-1706969187040.png

 

Step 2: Hit that send button...... yessss....

 

postmaaaaan.PNG

 
 

Here is the Sample response....

{"result":{"size_bytes":"79711153","file_name":"Learning Web Design _ A Beginner’s Guide to HTML, CSS, JavaScript, and Web Graphics ( PDFDrive ).pdf","sys_mod_count":"0","average_image_color":"","image_width":"","sys_updated_on":"2024-02-03 13:53:33","sys_domain_path":"!!!/!!!/","sys_tags":"","table_name":"x_angda_jira_demo_jira_staging_table","sys_id":"5ec714c79704ca5059f474971153af83","image_height":"","sys_updated_by":"saurabh.dubey","download_link":"https://--------.service-now.com/api/now/attachment/5ec714c79704ca5059f474971153af83/file","content_type":"application/pdf","sys_created_on":"2024-02-03 13:53:33","size_compressed":"65839905","sys_domain":{"link":"https://ven05583.service-now.com/api/now/attachment/domain/09ff3d105f231000b12e3572f2b4775d","value":"09ff3d105f231000b12e3572f2b4775d"},"compressed":"true","state":"pending","table_sys_id":"0ddb8b5c9757391059f474971153afc7","chunk_size_bytes":"700000","hash":"d883135a99f1a005006888d0dd2654630b7bcf95059f5b63d145dd589971fda8","sys_created_by":"saurabh.dubey"}}
 
Also, it seems that you have taken some external post or your org might be using some  and might have came to the conclusion that it can't be done, also try to use above steps....
 
If you find my answer helpful do hit the helpful button

 

View solution in original post

8 REPLIES 8

saurabh_dubey
Kilo Sage

955xK.png

 

Also, do checkout this stackover flow post....

but the above snip should help...

https://stackoverflow.com/questions/16015548/how-to-send-multipart-form-data-request-using-postman

 

If my reply helps you please don't forget to hit the helpful button...

 

@saurabh_dubey I have seen above post and several other posts and none of them have a working solution 🙂

Alright @Suggy  may I know the step that you followed from POST man to reproduce the steps.

I followed these steps:

 

Suggy_0-1706966406385.pngSuggy_1-1706966423244.png

 

and got below error:

 

{
"error": {
"message": "Failed to create the attachment. File part might be missing in the request.",
"detail": null
},
"status": "failure"
}