Using Messenger bot to get data from a json url and show it to user

685 Views Asked by At

I am currently having a problem with messenger bot development in which i want to get data from a url which shows in json format and then if a user types "show me the new news from university?" then it should get data from there and show. I don't know how to do this. please help.

Url for example : https://vitacademics-rel.herokuapp.com/api/v2/vellore/spotlight

1

There are 1 best solutions below

0
On

If you haven't already, you'll need to get a server set up to listen for webhook events and send replies - Facebook have published a Quick Start guide to help.

Your bot will need to listen for an event, check to see if the user's message contains "show me the new news from university?", perform the HTTP GET request from the server side, convert the data into messages Facebook understands then send it. Exactly how you listen for events and perform the HTTP GET request will depend on the language and framework(s) you are using for your bot's server.