How to fetch ServiceNow Instance version using a REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2019 11:17 PM
Hi,
I need a REST end point using which I can fetch instance version of my ServiceNow instance.
Many people have posted a URL
https://<instancename>.service-now.com/xmlstats.do
which gives XML output, however due to some reason this URL is not accepting user name/password while calling it from a script or curl call and authentication fails.
Anyways a REST api which is documented is better than calling an internal API which might change in future. Can anyone help?
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-01-2019 03:08 AM
Hi,
I don't think there is an API to give this information other than calling that mentioned URL.
What issue are you facing with curl and calling that URL. I tried with below command it's working for me
curl --user username:password --header "Accept: application/json" https://your-instance.service-now.com/stats.do
Replace above with your instance credentials and the instance URL and it should work.
Mark the answer as correct and helpful if this works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-01-2019 03:13 AM
The URL works:
curl --user username:password --header "Accept: application/json" https://your-instance.service-now.com/stats.do
and gives output as HTML from which I don't want to extract information.
curl --user username:password --header "Accept: application/json" https://your-instance.service-now.com/xmlstats.do
This does not work unfortunately, it gives XML output and easily parsable.