Skip to main content

Initiate flow

The initiate flow API can be called to start a chatflow. An example chatflow can look like 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
mediumstringRequiredMessages will be send through this medium
flowIdstringRequiredChatbot flow id
phoneNumberstringOptionalPhone number of the user
emailstringOptionalemail of the user
namestringOptionalName of the user
nodeNamestringOptionalName of the chatbot flow's node
businessPhoneNumberstringOptionalBusiness phone number from which you want to trigger the flow
sessionIdstringOptionalBik session Id
carryPayload[key: string]: string[]OptionalInitiate chat flow payload
payloadAbandonedCartPayloadOptionalAbandonedCart Payload

AbandonedCartPayload Type

NameTypeRequired/OptionalDescription
checkoutIdstringRequiredCheckout Id
phoneNumberstringRequiredCustomer Phone number
emailstringOptionalCustomer email
abandonedCartAbandonedCartRequiredAbandonedCart details

AbandonedCart Type

NameTypeRequired/OptionalDescription
idstringRequiredId
phoneNumberstringRequiredCustomer Phone number
convertedbooleanRequiredConvert to order
cartPricenumberRequiredTotal cart value
partnersDataPartnerDataRequiredPartnerData
cartBikOrderItem[]RequiredTotal order items

BikOrderItem Type

NameTypeRequired/OptionalDescription
namestringRequiredProduct name
pricenumberRequiredProduct price
quantitynumberRequiredProduct quantity
productIdnumberRequiredproduct id
variantIdnumberOptionalProduct variant id

Request Information

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

Sample request

You can start the chatflow by calling the below API :

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

If you're triggering the abandoned cart flow you can also pass in the abandoned cart context in the initiate flow API

{
"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
statusnumberFlow status