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

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 '{
"appId": "APP_ID",
"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

{
"appId": "APP_ID",
"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",
}
}

Request Information

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

Input Schema for request

FieldTypeMeaning
mediumstring*Messages will be send through this medium
appIdstring*Application id of the store
flowIdstring*Chatbot flow id
phoneNumberstringPhone number of the user
emailstringemail of the user
namestringName of the user
nodeNamestringName of the chatbot flow's node
businessPhoneNumberstringBusiness phone number from which you want to trigger the flow
sessionIdstringBik session Id
carryPayload[key: string]: string[]Initiate chat flow payload
payloadAbandonedCartPayload objectAbandonedCart Payload

phoneNumber and email both are optional but at least one is required. Get yoursessionId using externalAPI block in the journey builder and scope of the sessionId is with in the flow.

Output Schema for request

FieldTypeMeaning
statusnumberFlow status