How to check ServiceNow instance version through REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 11:08 AM
Hi, I'm using table API to communicate with ServiceNow instance. Is there anyway I can get the ServiceNow instance version through table API please?
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 06:10 PM
Consider creating your own scripted REST API. This gives you full control over the request/parameters/response.
Also, check episode 23 here: TechNow Episode List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2017 12:40 AM
Hi,
Instead of using table level Rest API, you can directly access "xmlstats.do" page through Rest call (server side) and find instance details through XMLNode. Please find below example :
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://<INSTANCE_NAME>.service-now.com/xmlstats.do');
request.setHttpMethod('GET');
request.setRequestHeader("Accept","application/xml");
var response = request.execute();
/** Find Instance version by XML node from response **/
var xmlString = response.getBody();
var xmldoc = new XMLDocument(xmlString, true);
var instance_version = xmldoc.getNodeText("//glide.build.name");
gs.print(instance_version);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 08:58 AM
Documenting lightweight approach :
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://<INSTANCE>.service-now.com/stats.do');
request.setHttpMethod('GET');
request.setRequestHeader("Accept","text/html");
var response = request.execute();
var xmlString = response.getBody();
if(xmlString) {
var preString = "Build name:";
var searchString = "<br/>";
var preIndex = xmlString.indexOf(preString);
var searchIndex = preIndex + xmlString.substring(preIndex).indexOf(searchString);
gs.print(xmlString.substring(preIndex + preString.length, searchIndex));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2018 04:03 AM
I don't see any reply which specifies rest api which returns build name i.e. instance version in JSON format. If you have found one, please post it here. I am looking for the same.