Closed DanEhrlich closed 8 years ago
Sounds like you forgot to enable the API in ServiceNow.
Pretty sure it is enabled as the REST Explorer works.
Then I don't know, sorry.
You could try out python-servicenow-rest if you're using Eureka or later (it's for the SN REST API): https://github.com/rbw0/python-servicenow-rest
Just saw this project. Got https://github.com/shaiguitar/snowclient.py#readme going earlier yesterday ( REST api access a-la /api/now/v1/table/ endpoints ). At this point has GET single resource and collection access, but the post/delete stuff should be pretty easy to add in.
Also has a query parser so date querying/OR'ing/ordering those service now quirks is a little easier to manage (QueryBuilder):
https://github.com/shaiguitar/snowclient.py/blob/master/tests/querybuilder_tests.py#L10
As well as walking embedded link
tags within a result
object the api returns back - https://github.com/shaiguitar/snowclient.py/blob/master/tests/client_tests.py#L62-L71
Feedback/Contributions appreciated.
DanEhrlich, after Dublin version, of Service-Now, api works by default with JSONv2. http://wiki.servicenow.com/index.php?title=JSONv2_Web_Service#gsc.tab=0
If you want to enable JSON you need activate the plugin: http://wiki.servicenow.com/index.php?title=Legacy:JSON_Web_Service#gsc.tab=0
What do I need to do to get json back from a query instead of a html web page?