Skip to main content

Python API client for zammad

Project description

https://img.shields.io/pypi/v/zammad_py.svg https://img.shields.io/travis/joeirimpan/zammad_py.svg Documentation Status Updates

Python API client for zammad

Quickstart

from zammad_py import ZammadAPI

# Initialize the client with the URL, username, and password
# Note the Host URL should be in this format: 'https://zammad.example.org/api/v1/'
client = ZammadAPI(url='<HOST>', username='<USERNAME>', password='<PASSWORD>')

# Example: Access all users
this_page = client.user.all()
for user in this_page:
    print(user)

# Example: Get information about the current user
print(client.user.me())

# Example: Create a ticket
params = {
   "title": "Help me!",
   "group": "2nd Level",
   "customer": "david@example.com",
   "article": {
      "subject": "My subject",
      "body": "I am a message!",
      "type": "note",
      "internal": false
   }
}
new_ticket = client.ticket.create(params=params)

General Methods

Most resources support these methods:

.all(): Returns a paginated response with the current page number and a list of elements.

.next_page(): Returns the next page of the current pagination object.

.prev_page(): Returns the previous page of the current pagination object.

.search(params): Returns a paginated response based on the search parameters.

.find(id): Returns a single object with the specified ID.

.create(params): Creates a new object with the specified parameters.

.update(params): Updates an existing object with the specified parameters.

.destroy(id): Deletes an object with the specified ID.

Additional Resource Methods

User resource also has the .me() method to get information about the current user.

Ticket resource also has the .articles() method to get the articles associated with a ticket.

Link resource has methods to list, add, and delete links between objects.

TicketArticleAttachment resource has the .download() method to download a ticket attachment.

Object resource has the .execute_migrations() method to run migrations on an object.

You can set the on_behalf_of attribute of the ZammadAPI instance to do actions on behalf of another user.

Contributing

The Zammad API Client (zammad_py) welcomes contributions.

You can contribute by reporting bugs, fixing bugs, implementing new features, writing documentation, and submitting feedback.

To get started, see the contributing section in the docs!

Please ensure that your changes include tests and updated documentation if necessary.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

zammad_py-3.2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

zammad_py-3.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file zammad_py-3.2.0.tar.gz.

File metadata

  • Download URL: zammad_py-3.2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.10 Linux/6.14.5-100.fc40.x86_64

File hashes

Hashes for zammad_py-3.2.0.tar.gz
Algorithm Hash digest
SHA256 6639d3b33590aa4b4fcb9e5a7b186578840800318cb5fc6adf0e33e8d503ee75
MD5 5ec3c779dd5ece1467286dc9d54672e9
BLAKE2b-256 8edc21cc67602f902bd65ab76a70e28d0a2d7f2c37f1b05f3cf62b2d5c68b7db

See more details on using hashes here.

File details

Details for the file zammad_py-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: zammad_py-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.10 Linux/6.14.5-100.fc40.x86_64

File hashes

Hashes for zammad_py-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5457687279de6b7937991d681ff6094f69a9796b6ced7c7444630191272f42ae
MD5 43909d78c6f01356e8ce7d19198b03b1
BLAKE2b-256 c85aa4303093c9b3662c7a6a20a9a977fe4cf0327d26a827b2c75793df3223c1

See more details on using hashes here.

Supported by

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