- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 05:29 AM
Hello Everone,
I want to create a record using Scripted Rest Api.
Here is my code:
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var gr=new GlideRecord('sn_customerservice_case');
gr.initialize();
gr.description="Testing going on"
gr.impact="4";
var abc=gr.insert();
return "Sys id is "+abc;
})(request, response);
When I am inserting a its showing this error from POSTMAN
Error:
{
"error": {
"detail": "",
"message": "java.lang.IllegalArgumentException: Cannod decode: java.io.StringReader@1142887"
},
"status": "failure"
}
Solved! Go to Solution.
- Labels:
-
Benchmarks
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 07:56 AM
Hi Rahul,
In postman add the content body in the body part and select raw as the format then you should get an area to put the json request body and add the body there and hit the endpoint
format in your earlier screenshot is form-data make it to raw
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 07:56 AM
Hi Rahul,
In postman add the content body in the body part and select raw as the format then you should get an area to put the json request body and add the body there and hit the endpoint
format in your earlier screenshot is form-data make it to raw
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 08:08 AM
Thanks Ankur, for your answer.
My whole day got wasted in this small thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 11:02 AM
That was a learning for you and should be fine.
Could you also mark it as helpful and hit like. If you wish you can endorse the content as well.
Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2017 10:37 PM
Thanks for your help Ankur. Ya basically I am new to Servicenow so learning from my mistakes.
I already marked it as helpful.