I have already created a Facebook messenger bot without using any AI technology integration. Currently the bot simply replies from the limited conditions i have put.for eg, reply with time when someone types 'time', or greet when someone type 'Hi'. Now i want to Integrate Api.ai with the bot, most tutorial suggest to start a new page and integrate api there. PS : my current page is public.
Asked
Active
Viewed 388 times
0
-
What exactly is your question? Apparently you even have tutorials telling you how to get started. – r41n Jun 06 '17 at 14:07
-
what i mean to say is that, there are ways to integrate api.ai directly into your fb page and you can customize your responses at api.ai workspace, but i already have a running page and i don't want to create a new page, so is there any possible solution like simple API requests through cURL or like that. @r41n – Himanshu Kantharia Jun 06 '17 at 17:37
1 Answers
0
You need to go to the Integration tab on API.ai and turn on the integration with Messenger and follow the steps.
Basically what will happen is that in the API.ai page, you will place the webhook url of your Messenger bot in the Fulfillment tab.
In your Facebook page (in the developer portal) you will place the API.ai url (the one that appears in the Integration of the API.ai bots.api.ai ... ) in the Webhook field (where your backend url used to be). This way, Facebook will make a request to API.ai, API.ai will make the natural language interpretation and call your backend.
You will have to change your backend to expect API.ai requests instead of Facebook requests.
There is a complete tutorial here.

Taís Bellini
- 197
- 4
-
Actually the problem is that, i already have a heroku webhook set for the page, so i cannot set api.ai callback url here. – Himanshu Kantharia Jun 06 '17 at 18:16
-
So, your heroku url should be placed in API.ai, and the API.ai callback should be placed where your heroku URL is right now. Because Facebook will now first call API.ai to interpret the natural language, and then API.ai will call your backend to perform whatever action your bot does and reply to Facebook. Check the tutorial to see how your response should look like. – Taís Bellini Jun 07 '17 at 15:52
-
Thanks @tais , the other option i found is using SDKs. I am still facing some problems with SDKs, I will update the answers afterwards. – Himanshu Kantharia Jun 09 '17 at 07:48