Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Not able to attach files to incident through REST API

nehasr1288
Tera Expert

When I try to raise an incident using rest api ,I

tried to attach a file but the incident is raised but file is not attached

Capture.png

1 ACCEPTED SOLUTION

Hi Neha,



I was able to do this successfully.



You should change sys_id to table_sys_id and also check the post query string checkbox. Please try and let me know



find_real_file.png




Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

11 REPLIES 11

Can you provide a valid content-type? It shows the content type is incorrect. What have you provided?



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


These should be included in header



--header "Accept:application/json"


--header "Content-Type:multipart/form-data"



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


I tried doing that but it seems it could not get the table now.Now I don't see the old error atleast



find_real_file.png


Hi Neha,



I was able to do this successfully.



You should change sys_id to table_sys_id and also check the post query string checkbox. Please try and let me know



find_real_file.png




Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Yes it worked that way.Thank you so much again



find_real_file.png