- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 09:50 AM
Hey VJ,
Take a look at this article here, should contain all you need.
Thanks,
Ethan
Please mark my answer as correct or helpful if it aided in solving your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 09:57 AM
Hi,
Didn't get completely the use-case
You can use OOB Table API with DELETE method
OR
You can use Scripted REST API with Delete HTTP method
Regards
Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 11:27 PM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 09:57 AM
Hi,
On Scripted REST API use DELETE HTTP method.
Make the script based on your requirement that is when you need to perform delete operation.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2022 10:04 AM
Hello,
I am adding little elaborative answer, I have pasted below code you need to write down code on similar lines.
Note: Instead of passing name in payload you can pass it as path parameter.
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var name = request.pathParams.name || null;
if (!name)
return new sn_ws_err.BadRequestError("Change Request id not provided");
var result = {};
var record = new GlideRecord('x_test');
if(record.get('name', name)){
if (!record.deleteRecord())
return new sn_ws_err.BadRequestError("Change Request not deleted");
else{
result.status = 'success';
response.setStatus(200);
response.setBody(result);
}
}else
return new sn_ws_err.NotFoundError("Change Request not found");
})(request, response);
Step1: Create a scripted REST API with proper name (e.g. Test Table APIs )
Step 2: Create a DELETE scripted REST Resource as shown in below screenshot