HomeUser GuidesAPI Reference
Get Started
HomeAPI Reference
Authentication
Branches
Contact Groups
Contacts
Conversations
Error HandlingInvoices
Messages
Orders
Rate LimitingSDKs & Code ExamplesTemplatesTicketsAPI VersioningWABA NumbersWebhooks
User GuideAPI ReferenceTickets

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

ParameterTypeRequiredDescription
idintegerYesConversation/event ID

Query Parameters

ParameterTypeRequiredDescription
phone_number_idstringYesSender phone number ID

Request Body (JSON)

ParameterTypeRequiredDescriptionDefault
routestringYesAction route: openTicketopenTicket

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

ParameterTypeRequiredDescription
idintegerYesConversation/event ID

Query Parameters

ParameterTypeRequiredDescription
phone_number_idstringYesSender phone number ID

Request Body (JSON)

ParameterTypeRequiredDescriptionDefault
routestringYesAction route: closeTicketcloseTicket

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

CodeDescriptionCauseSolution
400Bad RequestInvalid dataCheck sent data
404Not FoundConversation not foundCheck conversation ID
409ConflictTicket already openCheck ticket status

Related Sections

Conversations

Manage conversations linked to tickets

View Guide
View

Messages

Send messages in ticket context

View Guide
View

Technical Support

Need help?

  • šŸ“§ Email: support@awalchat.com
  • šŸ’¬ Live Chat: Available in the dashboard
  • šŸ“± WhatsApp: Contact us directly via WhatsApp
  • šŸ“š Examples: Check Code Examples