Share feedback, ideas and get community help

Updated 3 months ago

PrefilledVariables

I start the typebot via api through a POST request via axios in my TypeScript project.
Everything is working correctly except passing profilledVariables.
I'm passing it as an object in the axios request, but TypeBot doesn't "capture" the values of these variables.
My typebot is self-hosted via docker.
Has anyone managed to use PrefilledVariables in a self-hosted environment?
1
t
J
i
18 comments
Can you tell me how you did it?
I believe that what he is trying to do is not what this part of the documentation shows.

It intends to use the API (https://docs.typebot.io/api-reference/chat/start-chat) I also tried to use it and was unsuccessful.
Exactly what I'm doing, but the variable is not populated at all!
Returns like this:
{
"type": "p",
"children": [
{
"text": "Nome: "
},
{
"type": "inline-variable",
"children": []
}
]
},
I'm making the request like this:
const reqData = {
isStreamEnabled: true,
isOnlyRegistering: false,
prefilledVariables: {
numberContact: data.key.remoteJid.split('@')[0]

data.from.split('@')[0],
nameContact: data.verifiedBizName

data.pushName || 'Anônimo'
}
};

const config = {
headers: {
'Content-Type': 'application/json',
Accept: 'application/json'
},
maxBodyLength: Infinity
};

const request = await axios.post(${url}/typebots/${typebotName}/startChat, reqData, config);
Yes!
I'm doing exactly what the documentation says, but I can't pass variables in startChat.
I'm using version 2.22.2.
I'm using it and it's working, I just can't pass variables in startChat: https://docs.typebot.io/editor/variables#prefilled-variables
what version are you using?
I'm also using version 2.22.2

I'm having the same problem as you.
I'll try to downgrade and test which version it will work on...
I'll see in git if there is any case about this.
Is it working when you test on dashboard? If it is, then the problem is at your code part. console.log("reqData",reqData) before sending the request and take the screenshot and post here please.
I am also using same version, and it is working.
Sorry!
I misunderstood how "profilledVariables" worked, I thought there was no need to create them within the flow, I was just using them by typing {{name_of_variable}}.
Now everything is working 100%!
Once again, sorry for the intrusion.
No problem, we all miss something.
nice insight, btw anyone have integrate typebot to telegram via api? just curious how it can handle the button and upload file
Add a reply
Sign up and join the conversation on Discord