
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:27 AM
Hello all,
I am using the scriptable REST API to delete some data from a target SN environment
var r = new RESTMessageScripted("post", "https://"+instanceName+".service-now.com/sys_user_grmember.do");
r.addHeader("Content-Type", "application/json");
r.addRequestParameter("JSONv2", "true");
r.addRequestParameter("sysparm_query", 'sys_id='+id);
r.addRequestParameter("sysparm_action", "delete");
r.setBasicAuth(authenticatingUsername, authenticatingPassword);
response = r.execute();
This doesnt seem to work. The response code that i am getting is 200 so i dont think it is the authentication issue. What am i missing?
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:35 AM
var request = new GlideHTTPRequest ('https://myinstance/api/now/table/incident/0fbbeddad47e1100a92e188eafa1dd60');
request.setBasicAuth("admin","admin");
request.addHeader('Accept','application/json');
request.addHeader('Content-Type','application/json');
var response = request.del();
gs.log(response.getStatusCode());
gs.log(response.getBody());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:33 AM
Hi Ravio,
You may find the below thread helpful.
https://community.servicenow.com/people/john.andersen/blog/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:35 AM
var request = new GlideHTTPRequest ('https://myinstance/api/now/table/incident/0fbbeddad47e1100a92e188eafa1dd60');
request.setBasicAuth("admin","admin");
request.addHeader('Accept','application/json');
request.addHeader('Content-Type','application/json');
var response = request.del();
gs.log(response.getStatusCode());
gs.log(response.getBody());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 11:40 AM
Thanks Mike. Got 2 questions: 1) Is this REST? 2) Does this use https? As by the API name it looks like it doesnt but the paramter used seems https.