📅  最后修改于: 2023-12-03 15:21:22.957000             🧑  作者: Mango
Welcome to the documentation for Zammad Ticket APIs! In this guide, we will cover everything you need to know to start interacting with the Zammad Ticket APIs, including authentication, endpoints, request bodies, and response formats.
All Zammad Ticket API requests are authenticated using an API key. To obtain an API key, follow these steps:
To authenticate your API requests, include your API key in the request headers:
GET /api/v1/tickets HTTP/1.1
Host: your.zammad.instance.com
Authorization: Token token=yourapikeyhere
Zammad Ticket APIs provide access to a variety of resources, including tickets, organizations, users, and more. Here are some examples of endpoints:
/api/v1/tickets
: returns a list of tickets/api/v1/tickets/:id
: returns a specific ticket/api/v1/organizations
: returns a list of organizations/api/v1/organizations/:id
: returns a specific organization/api/v1/users
: returns a list of users/api/v1/users/:id
: returns a specific userYou can view the full list of endpoints in the Zammad Ticket API documentation.
Depending on the endpoint, you may need to include a request body in your API requests. Here are some examples of request bodies:
POST /api/v1/tickets
{
"title": "New ticket",
"customer_id": 42,
"group_id": 1,
"state_id": 1,
"article_attributes": {
"subject": "Article subject",
"body": "Article body",
"type": "note",
"internal": false
}
}
PUT /api/v1/tickets/:id
{
"state_id": 2
}
Zammad Ticket APIs return data in JSON format. Here is an example of a response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"title": "Ticket title",
"state_id": 1,
"group_id": 1,
"customer_id": 42,
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z",
"articles": [
{
"id": 1,
"ticket_id": 1,
"subject": "Article subject",
"body": "Article body",
"type": "note",
"internal": false,
"created_at": "2021-01-01T00:01:00Z",
"updated_at": "2021-01-01T00:01:00Z"
}
]
}
That's it for the Zammad Ticket APIs documentation! For more detailed information, please refer to the official Zammad Ticket API documentation.