Python ServiceNow API Wrapper
Project description
ServiceNow API
Version: 0.20.58
ServiceNow API Python Wrapper
This repository is actively maintained and will continue adding more API calls
Contributions are welcome!
All API Response objects are customized for the response call. You can get all return values in a parent.value.nested_value format, or you can run parent.model_dump() to get the table in dictionary format.
API Calls:
- Application Service
- Change Management
- CI/CD
- CMDB
- Import Sets
- Incident
- Knowledge Base
- Table
Usage:
OAuth Authentication
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
client_id = "<SERVICENOW CLIENT_ID>"
client_secret = "<SERVICENOW_CLIENT_SECRET>"
servicenow_url = "<SERVICENOW_URL>"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password,
client_id=client_id,
client_secret=client_secret)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Basic Authentication
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
servicenow_url = "<SERVICENOW_URL>"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Proxy and SSL Verify
#!/usr/bin/python
# coding: utf-8
import servicenow_api
username = "<SERVICENOW USERNAME>"
password = "<SERVICENOW PASSWORD>"
servicenow_url = "<SERVICENOW_URL>"
proxy = "https://proxy.net"
client = servicenow_api.Api(url=servicenow_url,
username=username,
password=password,
proxy=proxy,
verify=False)
table = client.get_table(table="<TABLE NAME>")
print(f"Table: {table.model_dump()}")
Installation Instructions:
Install Python Package
python -m pip install servicenow-api
Tests:
python ./test/test_servicenow_models.py
Repository Owners:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file servicenow_api-0.20.58-py2.py3-none-any.whl
.
File metadata
- Download URL: servicenow_api-0.20.58-py2.py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7312b346e6f6f59403248e24b5e8b5c89e3f8ab38f65109b2dde772b1a039c64 |
|
MD5 | 0a3c88b34a0757ee9a403ff9298693e6 |
|
BLAKE2b-256 | 0387a0ad154b03c95365d0e088cb52ad0e4400a1e0a35e151cc983aca378a7c7 |