Button payload and displaying dynamic content


#1

Hey there,
i was wondering if i could press on the courasel buttons and load dynamic json data from a webpage
something like

“content”: {
“text”: “Test”,
“options”: [
{
“text”: “Option1”,
"uri": "https://linktomydata/data.php/json"
}
]
}

sorry if i missed a similar topic. i do not understand the language.

Regards


#2

just in case it’s not clear, i’m using messenger.


#3

Hi @B1Q,

Could you explain how are you creating your bot? Are you using SDK, HTTP API or Builder?

[For Builder]
In order to make any request from Builder to another API you must use HTTP Request action.
So, if your user click on your carousel button you need send the user to another block and in these new block you can make a request to load a dynamic json data from a webpage.

Could you elaborate a little bit more your question? Can you give a real example?


#4

gotcha… i’m using webhooks to send dynamic data to the user
i.e categories and products
How do i send the user to another block using the http api?
keep in mind that i’m using both the builder and the webhooks

With that being said… i’m not trying to make a bunch of blocks just to get this to work
I just want to have 2 or 3 blocks max
1 welcome block
1 categories block
1 products block

the categories & products blocks will load dynamic data from my webserver