T
Typebot5mo ago
gk

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
Michaelvips
Michaelvips5mo ago
I think you need send in json body { "prefilledVariables": { "name": "John" } }
gk
gk5mo ago
Thank you, @Michaelvips. It works perfectly! 👏🏻