Prefilled variable on startChat
Hey, everyone!
I know there is a way to set a value for a variable when starting a chat (as explained here: https://docs.typebot.io/editor/variables#prefilled-variables), but can I do the same when I'm starting the chat via API (using the startChat method)?
Using it this way, the URL would look like this:
https://bot.mydomain.com.br/api/v1/typebots/myBot/startChat?ContactName=test&PhoneNumber=123
2 Replies
I think you need send in json body
{
"prefilledVariables": {
"name": "John"
}
}
Thank you, @Michaelvips. It works perfectly! 👏🏻