Scripted Rest API Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2022 06:18 AM
Hi All,
below is the script that i written on scripted rest api. but its not working when i send data like https://google.com/gtre
can any one help me on this
(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var obj = {};
obj.number = request.pathParams.number;
obj.worknotes = request.pathParams.work_notes;
var gr = new GlideRecord("sc_req_item");
gr.addQuery("number", obj.number);
gr.query();
if (gr.next()) {
gr.work_notes = obj.worknotes;
gr.update();
response.setBody(obj);
}
})(request, response);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 08:10 AM
Hi Ankur,
but here i need to post the data in worknotes when automation is success. in that automation i received the output like URL format.
for that URL format i am receiving like "request uri does not conatin any resource"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 09:51 AM
You should encode your url
https://fsfe.ciewri/rjwerj
https%3A%2F%2Ffsfe.ciewri%2Frjwerj
For testing use
https://www.urlencoder.org/
Vinod Kumar Kachineni
Community Rising Star 2022