Python API client for zammad
Project description
Python API client for zammad
Free software: MIT license
Documentation: https://zammad-py.readthedocs.io.
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
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
Built Distribution
File details
Details for the file zammad_py-3.0.0.tar.gz
.
File metadata
- Download URL: zammad_py-3.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-75-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd770cf98721536ccc88de9461cf8be04e1c30f8def400ae8825f0e8ebe6a72 |
|
MD5 | ceb091f23778a046ee040f5e0b4277e5 |
|
BLAKE2b-256 | cc11531d67b8da82d028b9cd4e7587de0736856b4c8282fae45367363e9c4205 |
File details
Details for the file zammad_py-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: zammad_py-3.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-75-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59af11dec42b4edf16ea4d538cc3fa07bc47cf7efebdca214d21c6c5bf4a6e2f |
|
MD5 | 2b34080b0ae742a93e24fbd759dff722 |
|
BLAKE2b-256 | 0720c00c1d20426f0d1e435a491a7adf1e47ed665d1d8c7168fe91f9face23fc |