Skip to main content

Initiate flow

Triggers a chatbot flow for a specified user. An example chatflow is shown below.

flow id

info

Either email or phoneNumber must be provided; both cannot be empty at the same time. Get your sessionId using externalAPI block in the journey builder and scope of the sessionId is with in the flow.

Request parameters

NameTypeRequired/OptionalDescription
mediumstringRequiredChannel through which messages are sent
flowIdstringRequiredChatbot flow identifier
phoneNumberstringOptionalPhone number of the user
emailstringOptionalEmail address of the user
namestringOptionalName of the user
nodeNamestringOptionalName of the target node in the chatbot flow
businessPhoneNumberstringOptionalBusiness phone number from which the flow is triggered
sessionIdstringOptionalBIK session ID
carryPayload[key: string]: string[]OptionalKey-value payload to pass into the flow
payloadAbandonedCartPayloadOptionalAbandoned cart payload

AbandonedCartPayload Type

NameTypeRequired/OptionalDescription
checkoutIdstringRequiredCheckout identifier
phoneNumberstringRequiredCustomer phone number
emailstringOptionalCustomer email address
abandonedCartAbandonedCartRequiredAbandoned cart details

AbandonedCart Type

NameTypeRequired/OptionalDescription
idstringRequiredCart identifier
phoneNumberstringRequiredCustomer phone number
convertedbooleanRequiredWhether the cart was converted to an order
cartPricenumberRequiredTotal cart value
partnersDataPartnerDataRequiredPartner integration data
cartBikOrderItem[]RequiredArray of order items

BikOrderItem Type

NameTypeRequired/OptionalDescription
namestringRequiredProduct name
pricenumberRequiredProduct price
quantitynumberRequiredProduct quantity
productIdnumberRequiredProduct identifier
variantIdnumberOptionalProduct variant identifier

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-initiateFlow

Sample request

curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-initiateFlow' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"medium": "whatsapp",
"flowId": "test_flow_id",
"phoneNumber": "+919090909090",
"carryPayload: {
"id": "1234"
}
}'

JSON response example:

{
"status": 200
}

Abandoned Cart

To trigger an abandoned cart flow, include the abandoned cart context in the request payload.

{
"medium": "whatsapp",
"flowId": "test_flow_id",
"phoneNumber": "+919090909090",
"payload": {
"checkoutId": "CHECKOUT_ID",
"abandonedCart": {
"id": "ID",
"phoneNumber": "PHONE_NUMBER",
"cart": [{
"name": "NAME";
"price": 2000;
"quantity": 2;
"productId": 1234;
"variantId": 7890;
}],
"converted": true,
"cartPrice": 1000,
"partnersData": {
id: "PARTNER_ID";
source: "shopify";
customerId?: 1111;
},
},
"phoneNumber": "PHONE_NUMBER",
"email": "EMAIL",
}
}

Response parameters

NameTypeDescription
statusnumberHTTP status code indicating flow initiation result