Initiate flow
The initiate flow API can be called to start a chatflow. An example chatflow can look like below.
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
Category | Value |
---|---|
Http request | POST |
URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-initiateFlow |
Input Schema for request
Field | Type | Meaning |
---|---|---|
medium | string* | Messages will be send through this medium |
appId | string* | Application id of the store |
flowId | string* | Chatbot flow id |
phoneNumber | string | Phone number of the user |
email | string | email of the user |
name | string | Name of the user |
nodeName | string | Name of the chatbot flow's node |
businessPhoneNumber | string | Business phone number from which you want to trigger the flow |
sessionId | string | Bik session Id |
carryPayload | [key: string]: string[] | Initiate chat flow payload |
payload | AbandonedCartPayload object | AbandonedCart 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
Field | Type | Meaning |
---|---|---|
status | number | Flow status |