Sunbird dcTrack API client in Python
Project description
dcTrackClient
Sunbird dcTrack API client in Python
Initialize a connection to the dcTrack API
Import the class:
from dcTrackClient import Client
Authenticate using a base URL (the same URL to access the GUI) and a username and password:
api = Client('https://dctrack.example.com/', username='user', password='pass')
Authenticate using a base URL and an API token:
api = Client('https://dctrack.example.com/', apiToken='asdf')
Usage Example
Create an item:
- This example shows the minimum attributes required to create an item
- See the official documentation for a comprehensive list of attributes
- This function returns the JSON object for the newly created item
- If it fails, the function will return a JSON object containing the error message
api.createItem({'cmbLocation': 'CRT > 2ND > IT', 'tiName': 'NEW-ITEM', 'cmbMake': 'Generic', 'cmbModel': 'Generic^Rackable^01'})
Retrieve item details:
item = api.getItem(1234)
Returns:
{
"item": {
... // item attributes in here
}
}
Modify an existing item:
api.modifyItem(1234, {'tiSerialNumber': 'SN-12345', 'tiAssetTag': 'DEV-12345'})
Delete an existing item:
api.deleteItem(1234)
Official DcTrack Documentation
Visit this link for the official documentation on request bodies and attrribute names.
https://www.sunbirddcim.com/help/dcTrack/v900/API/en/Default.htm
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 Distribution
dctrackclient-0.1.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for dctrackclient-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fea2fa05096677f81a6efa1e0a0309d92f0fc34ee87877ef137189e6b1eb664 |
|
MD5 | 8140c166beafb026b1b4f544c1948120 |
|
BLAKE2b-256 | f77e4b25e2f201881e19e5f4ec2590ae045505db29634bd8149c95773e4e1013 |