Update Ticket
Endpoint: PUT /api/v6.1/ticket
Description: This API is used to update the information of an existing support ticket in the system, based on ticket_code.
Request
Method: PUT
Headers:
Content-Type: application/json
X-API-KEY: <your-api-key>
Body (JSON):
{
"ticket_title": "New Title",
"ticket_content": "<p>Updated content</p>",
"account_email": "[email protected]",
"cate_name": "New Category",
"status_name": "New Status",
"expected_at": "2025-01-01",
"custom_fields": {
"custom_field": "new value"
},
"emergency_phone": "0123456789",
"ticket_code": "ABCXYZ1234"
}
Response
Status: 200 OK
Sample Content:
{
"message": "Successfully updated",
"data": {
"identity": 1,
"ticket_code": "ABCXYZ1234"
}
}
Input Field Descriptions
| Field | Data Type | Description |
|--------|---------------|-------|
| ticket_code | string | Identifier of the ticket to update (required) |
| ticket_title | string | New title of the support ticket |
| ticket_content | string (HTML) | New content of the ticket |
| account_email | string | Related customer email |
| cate_name | string | New category name |
| status_name | string | New status name |
| expected_at | string (YYYY-MM-DD) | New expected completion date |
| custom_fields | object | New custom fields update |
| emergency_phone | string | Updated emergency phone number |\
Notes
- The
ticket_codefield is required to identify the ticket to update.\ - Other values will replace existing data.
cURL Example
curl --location --request PUT 'https://<ten-mien>/api/v6.1/ticket' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'Cookie: <session-cookie>' \
--data-raw '{
"ticket_title": "New Title",
"ticket_content": "<p>Updated content</p>",
"account_email": "[email protected]",
"cate_name": "New Category",
"status_name": "New Status",
"expected_at": "2025-01-01",
"custom_fields": { "extended_field": "new value" },
"emergency_phone": "0123456789",
"ticket_code": "ABCXYZ1234"
}'
Error Handling
| Error Code | Description |
|--------|------|
| 400 | Missing or invalid required field format |
| 401 | Unauthorized |
| 403 | No update permission |
| 404 | Ticket to update not found |
| 500 | Internal system error |\