Skip to main content

Create and Assign Ticket

Creates a ticket for a customer and optionally assigns it to an agent or team.

Request Parameters

NameTypeRequired/OptionalDescription
channelChannelsRequiredThe channel on which the ticket is created. Check the Channels type here.
labelIdsnumber[]OptionalIDs of the labels to assign to the ticket
brandEmailstringOptionalBrand email address (required for EMAIL channel)
customerEmailstringOptionalCustomer email address (required for EMAIL channel)
brandPhoneNumberstringOptionalBrand phone number (required for WHATSAPP channel)
customerPhoneNumberstringOptionalCustomer phone number (required for WHATSAPP channel)
taskTitlestringOptionalTitle of the task (required for TASKS channel)
assignmentTypeAssignmentTypesOptionalAssignment strategy for the ticket. Check the AssignmentTypes type here.
agentMailstringOptionalAgent email address (required when assignmentType is SPECIFIC_AGENT)
teamIdnumberOptionalTeam ID (required when assignmentType is SPECIFIC_TEAM)
contextstringOptionalAdditional context or notes 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",
"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
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded
data.ticket.idnumberUnique identifier for the created ticket
data.ticket.customerIdstringID of the customer associated with the ticket
data.ticket.storeIdstringStore identifier
data.ticket.agentIdnumberID of the assigned agent
data.ticket.teamIdnumberID of the assigned team (null if not assigned)
data.ticket.channelNamestringChannel on 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!"
}
]
}