Skip to main content

Create and Assign Ticket

Use this API to create a ticket for a customer from an external source into Bik.

Request Parameters

NameTypeRequired/OptionalDescription
channelChannelsRequiredThe channel through which the ticket is created. Check the Channels type here.
bikCustomerIdstringRequiredUnique identifier for the customer
labelIdsnumber[]OptionalIDs of the labels to assign to the ticket
brandEmailstringOptionalBrand email address (required for EMAIL channel)
customerEmailstringOptionalCustomer's email address (required for EMAIL channel)
brandPhoneNumberstringOptionalBrand phone number (required for WHATSAPP channel)
customerPhoneNumberstringOptionalCustomer's phone number (required for WHATSAPP channel)
taskTitlestringOptionalTitle of the task (required for TASKS channel)
assignmentTypeAssignmentTypesOptionalType of assignment for the ticket. Check the AssignmentTypes type here.
agentMailstringOptionalAgent's email address (required when assignmentType is SPECIFIC_AGENT)
teamIdnumberOptionalTeam ID (required when assignmentType is SPECIFIC_TEAM)
contextstringOptionalContext or additional information for the ticket

Request Information

CategoryValue
HTTP requestPOST
URLhttps://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

NameTypeDescription
statusnumberResponse status
successbooleanIndicates if the response is successful
data.ticket.idnumberUnique identifier for the ticket
data.ticket.customerIdstringID of the customer for whom the ticket is raised
data.ticket.storeIdstringStore identifier
data.ticket.agentIdnumberID of the assigned agent
data.ticket.teamIdnumberID of the assigned team (null if not assigned)
data.ticket.channelNamestringName of the channel through which the ticket was created

Channels Type

NameTypeDescription
WHATSAPPstringWhatsApp channel identifier
EMAILstringEmail channel identifier
TASKSstringTasks channel identifier

AssignmentTypes Type

NameTypeDescription
ALL_AGENTSstringAssign ticket based on store assignment logic settings (Round robin or Unassigned)
SPECIFIC_AGENTstringAssign ticket to a specific agent
SPECIFIC_TEAMstringAssign ticket to a specific team

Errors

Error CodeMeaning
400Invalid payload! -- Your request is invalid/invalid parameters.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
500Internal Server Error -- We had a problem with our server. Try again later.

Error response example:

{
"status": 400,
"errors": [
{
"message": "Invalid payload!"
}
]
}