Engati - User Guide
Engati APIs
API Trigger
16 min
1 introduction 1 introduction forward integrations would allow you to create an automation flow in your chatbot that can be triggered by an api without the need of an end user ever interacting with your chatbot you can create a form asking for information from clients and pass them into the api via params into attributes and use them to perform functions based on the input and accomplish the goals note this feature is only for whatsapp channel 2 availability 2 availability forward integrations are available in our enterprise plans based on an entitlement, please reach out to info\@engati com for assistance 3 working mechanism 3 working mechanism when a user would enter information in a form and the api is triggered in which the user inputs are passed as attributes via params then the flow will be executed, as an example in the below form my users would be entering the information and based on their category i would be generating and storing information in salesforce and send out emails 4 functioning 4 functioning 4 1 instructions for using the api method post request url https //api engati ai/bot api/v1 0/customer/\<customer id>/bot/\<bot key>/flow/\<flow key> parameters authorization basic \<api key> for whatsapp, if in any case, the user's name is not present with its phone number then the 'user user name' attribute will capture and store its phone number customer id – customer identifier will be available in the 'integrations' tab > engati api bot key – the bot key will be available in the 'integrations' tab > engati api api key – a key available in the 'integrations' tab > engati api that would be used for authentication purposes flow key – the key of the flow which you would like to have initiated when the api request is made you can access it by clicking on the " i " (path info) icon present at the top of the respective path 4 2 creation of the flow when the api will be triggered the attribute data will be passed through the api into the flow and this flow will be executed, as per your decision nodes and flows the process will be executed, so for example if i have a form that asks the end users their category vip or non vip, then based on that the flow will be triggered and executed 4 3 user tracking when the api will be triggered and the automation flow executed, a user will be created in the dedicated bot containing the details 4 4 api trigger curl for whatsapp version 1 curl location request post 'https //api engati ai/bot api/v1 0/customer/\<cid>/bot/\<bot key>/flow/\<flow key>?user phone no=\<phone number>\&resultcode=123\&operationid=test123' \\ \ header 'authorization basic \<api key>' version 2 when the api will be triggered the attribute data will be passed through the api into the flow and this flow will be executed these attributes can be configured in the request body of api curl location 'https //api engati ai/bot api/v2 0/customer/\<cid>/bot/\<bot key>/flow/\<flow key>' \\ \ header 'authorization basic \<api key>' \\ \ header 'content type application/json' \\ \ data '{ "user channel" "whatsapp", "user phone no" \<to number>, "attribute 1" "this is parameter 1", "attribute 2" "this is parameter 2" }' 4 5 api trigger curl for rcs engati allows you to trigger bot flows for users on the rcs (rich communication services) channel using the existing api trigger endpoint the api trigger for rcs works similar to whatsapp , with the only difference being that the channel parameter is set to rcs the flow key is included in the request url , not in the request body post https //api engati ai/bot api/v2 0/customer/{customer id}/bot/{bot id}/flow/{flow key} headers authorization basic \<api key> content type application/json request body the request body must contain the user channel and phone number { "user channel" "rcs", "user phone no" "\<to number>", "attribute 1" "this is parameter 1", "attribute 2" "this is parameter 2" } parameters true 309,309left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example curl request curl location 'https //api engati ai/bot api/v2 0/customer/{customer id}/bot/{bot id}}/flow/{flow key}' \ header 'authorization basic \<api key>' \ header 'content type application/json' \\ \ data '{ "user channel" "rcs", "user phone no" "\<to number>", "attribute 1" "this is parameter 1", "attribute 2" "this is parameter 2" }' how it works the api request triggers a specific flow using the flow key the user is identified using their phone number the flow is executed on the rcs channel the bot sends messages configured in the flow to the user's rcs enabled device important notes the flow key must always be part of the request url the channel must be specified as rcs in the request body the phone number must include the country code the user must have rcs enabled on their device to receive messages in case of issues please reach out to support\@engati com

