Python Api client for Service Now.
Api client for the docs table api.
See an example in the docs dir. tl;dr -
# re-tailor for your own uses (tablename here is 'incident', base url, auth, etc) client = Client("https://your-sandbox.service-now.com", user, password) recent_incidents = client.list("incident", sysparm_limit=1000, sysparm_query=build_query()) i = recent_incidents i.u_custom_field # returns custom value
You'll probably want to use the querybuilder to avoid having to do this yourself.
shai@adsk-lappy ~ % pip3.4 install snowclient Collecting snowclient Downloading snowclient-0.3.1.tar.gz ... ... Running setup.py install for snowclient Successfully installed snowclient-0.3.1
Per http://peterdowns.com/posts/first-time-with-pypi.html (depends on
Use something like "~/.snow-auth.json", either way load up basic auth and use
to start hacking away. Or you can just pass it in.
You'll also want/need to use the
QueryBuilder to abstract away some of
the nastiness of the original syntax necessary. See QueryBuilder tests for it's usage.
# or DEBUG=1 nosetests -s for python requests debugging # use --nocapture if you want to drop into pdb # or for more verbose nosetests -vvs tests/ # ultimately though: $ nosetests . ---------------------------- Ran 1 test in 0.003s
I'm using it, but consider it WIP. I built only the parts of the api I needed so this is not complete.
It will be over time if it gets the TLC it needs. Contributions very welcome of course.
Hope you find it helpful!