Tickets
API for managing support tickets linked to conversations
Reading time: 2 minutes
Tickets
Manage support tickets linked to conversations.
Open Ticket
POST
{{base_url}}/wechat/chat/events/{id}Open a new support ticket linked to a conversation.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Conversation/event ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phone_number_id | string | Yes | Sender phone number ID |
Request Body (JSON)
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
route | string | Yes | Action route: openTicket | openTicket |
Example Request
Example Requestbash
curl -X POST "https://api.awalchat.com/api/developer/wechat/chat/events/1?phone_number_id=123456" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-d '{
"route": "openTicket"
}'Example Response
Response200 OK
{
"status": true,
"message": "Ticket opened successfully",
"data": {
"ticket_id": 123,
"conversation_id": 1,
"status": "opened",
"opened_at": "2024-01-20T10:30:00Z"
}
}Tip: Open a ticket when you need to track a specific conversation as a support case.
Close Ticket
POST
{{base_url}}/wechat/chat/events/{id}Close an existing support ticket.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Conversation/event ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phone_number_id | string | Yes | Sender phone number ID |
Request Body (JSON)
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
route | string | Yes | Action route: closeTicket | closeTicket |
Example Request
Example Requestbash
curl -X POST "https://api.awalchat.com/api/developer/wechat/chat/events/1?phone_number_id=123456" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Awal-Signature-256: sha256=abc..." \
-H "X-Timestamp: 1704124800" \
-H "X-Domain: your-workspace" \
-H "X-Client-ID: your-client-id" \
-d '{
"route": "closeTicket"
}'Example Response
Response200 OK
{
"status": true,
"message": "Ticket closed successfully",
"data": {
"ticket_id": 123,
"conversation_id": 1,
"status": "closed",
"closed_at": "2024-01-20T15:30:00Z"
}
}Important Notes
š”
Tickets
- Ticket links a conversation with a support ticket
- Tickets can be opened and closed as needed
- Closed tickets can be reopened
ā ļø
Ticket Management
- Open a ticket when starting a new support case
- Close the ticket when the issue is resolved
- Review open tickets regularly
ā
Best Practices
- Use tickets to track support cases
- Link tickets to related conversations
- Update ticket status regularly
Use Cases
1. Open Ticket for New Conversation
// Open ticket when starting support conversation
await openTicket(conversationId, {
route: "openTicket"
});2. Close Ticket After Resolving Issue
// Close ticket when issue is resolved
await closeTicket(conversationId, {
route: "closeTicket"
});Error Codes
| Code | Description | Cause | Solution |
|---|---|---|---|
| 400 | Bad Request | Invalid data | Check sent data |
| 404 | Not Found | Conversation not found | Check conversation ID |
| 409 | Conflict | Ticket already open | Check ticket status |
Related Sections
Technical Support
Need help?
- š§ Email: support@awalchat.com
- š¬ Live Chat: Available in the dashboard
- š± WhatsApp: Contact us directly via WhatsApp
- š Examples: Check Code Examples