i am getting 500 as status code when to create incident in another instance through REST?

Manikantahere
Tera Contributor

May i know what are the possible reasons to get 500 as the http status?

 

int-1.pngint-2.png

2 ACCEPTED SOLUTIONS

Couple issues

 

request.body isn't the actual content but an object of different ways to access the body. request.body.data is likely what you're wanting. 

 

Also, on the GlideRecord, you need to pass in the table name as new GlideRecord('incident')

View solution in original post

Simon Christens
Kilo Sage

Can you log out whats request.body.data contains ? - check if anything is received

Can you provide the exact error you get - its hard to figure out when its just "500".
You should get a message with whats failing.

View solution in original post

10 REPLIES 10

Kieran Anson
Kilo Patron

HTTP 500 is an internal server error - as you're hitting a custom scripted REST API, there is likely something wrong with the script that is causing a runtime error. You can view the logs in your instance to see if an exception is being thrown 

int-3.png

 

this is the code i am using in BR can you provide help to where and what to change if possible?

The issue will be in the receiving code within the API you're hitting, not within your calling code 

ohh thanks for letting me know.. you can find same here

 

int-4.png