Skip to main content

A modern TOPdesk wrapper for Python

Project description

topdesk

An API client for TOPdesk in Python, using requests.

Installation

topdesk can be obtained through pip:

pip install topdesk

Usage

All requests are encapsulated in a Topdesk object. To construct this object, you need to supply it with a URL and username/token pair:

from topdesk import Topdesk

topdesk = Topdesk("<topdesk url>" app_creds=("<username>", "<token>"))

Then you can start requesting. Let’s get the API version!

print(topdesk.version())

This will return a dictionary representing the JSON body of the response. If it fails it will throw an exception that inherits from topdesk.HttpException, for instance topdesk.NotFound for 404 Not Found errors.

If you don’t have a token, you can also login as a person or operator. I wholeheartedly recommend tokens, though.

topdesk.login_person("<username>", "<password>")
# or alternatively
topdesk.login_operator("<username>", "<password>")

Then we can try and request some information! Let’s get a list of incidents that are not resolved, and order them by their target date!

print(topdesk.incidents({'order_by': "target_date+ASC", 'resolved': False}))

The API is somewhat well documented. You can explore it from your REPL through the help function or look at the autogenerated documentation.

Caveats

The Knowledge Base API is currently not supported, because it uses GraphQL whereas the rest of the API uses REST. If you have experience with and/or interest in GraphQL, I invite you to submit a patch!

The Supporting Files API is not yet supported. It’s a large swath of useful API functions that we do not wrap until now. If you need to use any of the endpoints, you’ll have to fall back to the lower-level get, put, patch, post, and delete methods.


Have fun!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topdesk-0.0.16.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topdesk-0.0.16-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file topdesk-0.0.16.tar.gz.

File metadata

  • Download URL: topdesk-0.0.16.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.11

File hashes

Hashes for topdesk-0.0.16.tar.gz
Algorithm Hash digest
SHA256 2b37d815bc20fbd179a8d8f2df0143ffe75bc6861acec0351de8404efd8dcc53
MD5 c6ff962cfd66df136169c7d55722143c
BLAKE2b-256 e8e1333df902a0ea7de124666c67633c7ce8ef7a3d12dd9c2b3737b00ca37ddb

See more details on using hashes here.

File details

Details for the file topdesk-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: topdesk-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.11

File hashes

Hashes for topdesk-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe916c712ad999fc85296091dbe03e1381bf61a077b2c65fff87ce7cfb63c50
MD5 9544d4e90282b1c718930828aff0b805
BLAKE2b-256 c821bfbc9ae51583d62c1dec73e268f33751656189fbc2f670f2f4025438ad95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page