Create and Assign Ticket
Use this API to create a ticket for a customer from an external source into Bik.
Request Parameters
Name | Type | Required/Optional | Description |
---|---|---|---|
channel | Channels | Required | The channel through which the ticket is created. Check the Channels type here. |
bikCustomerId | string | Required | Unique identifier for the customer |
labelIds | number[] | Optional | IDs of the labels to assign to the ticket |
brandEmail | string | Optional | Brand email address (required for EMAIL channel) |
customerEmail | string | Optional | Customer's email address (required for EMAIL channel) |
brandPhoneNumber | string | Optional | Brand phone number (required for WHATSAPP channel) |
customerPhoneNumber | string | Optional | Customer's phone number (required for WHATSAPP channel) |
taskTitle | string | Optional | Title of the task (required for TASKS channel) |
assignmentType | AssignmentTypes | Optional | Type of assignment for the ticket. Check the AssignmentTypes type here. |
agentMail | string | Optional | Agent's email address (required when assignmentType is SPECIFIC_AGENT) |
teamId | number | Optional | Team ID (required when assignmentType is SPECIFIC_TEAM) |
context | string | Optional | Context or additional information for the ticket |
Request Information
Category | Value |
---|---|
HTTP request | POST |
URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-createAndAssignTicket |
Sample Request
curl --location --request POST 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-createAndAssignTicket' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"channel": "whatsapp",
"bikCustomerId": "5233549",
"assignmentType": "ALL_AGENTS",
"brandPhoneNumber":"+917827486670",
"customerPhoneNumber": "+918095495490"
}'
JSON response example:
{
"status": 200,
"success": true,
"data": {
"ticket": {
"id": 303455,
"customerId": "5233549",
"storeId": "p60HYv5wjgQaOrPdqT5NjbpkroD2",
"agentId": 17643,
"teamId": null,
"channelName": "whatsapp"
}
}
}
Response parameters
Name | Type | Description |
---|---|---|
status | number | Response status |
success | boolean | Indicates if the response is successful |
data.ticket.id | number | Unique identifier for the ticket |
data.ticket.customerId | string | ID of the customer for whom the ticket is raised |
data.ticket.storeId | string | Store identifier |
data.ticket.agentId | number | ID of the assigned agent |
data.ticket.teamId | number | ID of the assigned team (null if not assigned) |
data.ticket.channelName | string | Name of the channel through which the ticket was created |
Channels Type
Name | Type | Description |
---|---|---|
WHATSAPP | string | WhatsApp channel identifier |
EMAIL | string | Email channel identifier |
TASKS | string | Tasks channel identifier |
AssignmentTypes Type
Name | Type | Description |
---|---|---|
ALL_AGENTS | string | Assign ticket based on store assignment logic settings (Round robin or Unassigned) |
SPECIFIC_AGENT | string | Assign ticket to a specific agent |
SPECIFIC_TEAM | string | Assign ticket to a specific team |
Errors
Error Code | Meaning |
---|---|
400 | Invalid payload! -- Your request is invalid/invalid parameters. |
401 | Unauthorized -- User is not authenticated. |
404 | Not Found -- The specified API could not be found. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
Error response example:
{
"status": 400,
"errors": [
{
"message": "Invalid payload!"
}
]
}