facebook-messenger

Identifying Facebook Messenger user with UserID from a Facebook Login

依然范特西╮ 提交于 2019-12-04 07:40:38
问题 I am trying out the new Facebook Messenger Platform and have hit a bit of a problem. When a user first chats with my Bot, I want to use the sender.id to lookup the user in my DB and verify whether they're a customer or not and offer a more tailored UX. User's sign up to my service using Facebook Login, but unfortunately it appears my App's Facebook ID & my Bot's Facebook ID are different due to IDs being limited to App-scopes. Is there any way associate the 2 IDs to allow me to find a user in

Facebook Messenger API - Persistent Menu not working on mobile

风流意气都作罢 提交于 2019-12-04 07:11:50
I am making a php curl call to the API endpoint to set up a persistent menu based on the documentation . Here is the code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/v2.6/me/thread_settings?access_token='.FB_ACCESS_TOKEN); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postbody); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $output = curl_exec($ch); curl_close(

Python requests response encoded in utf-8 but cannot be decoded

让人想犯罪 __ 提交于 2019-12-04 05:57:00
I am trying to scrape my messenger.com (facebook messenger) chats using python and i have used google chromes developer tools to see the POST request for the chat history and i have copied the entire header and body into a format that requests can use. I get HTTP code 200 implying the request at least got something but and i can print res.encoding to get the encoding it returned in which it says is utf-8. But i cannot decode it! here is the function: def download_thread(self, limit, offset, message_timestamp): """Download the specified number of messages from the provided thread, with an

how to setup “Get started” button in facebook messenger bot and when to send welcome message

寵の児 提交于 2019-12-04 03:54:46
"Get Started" tried sending request to this url https://graph.facebook.com/v2.6/PAGE_ID/thread_settings?access_token=PAGE_ACCESS_TOKEN But didn't work. Make a POST call to API JSON body as below. curl -X POST -H "Content-Type: application/json" -d '{ "setting_type":"call_to_actions", "thread_state":"new_thread", "call_to_actions":[ { "payload":"USER_DEFINED_PAYLOAD" } ] }' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN" Ref: Facebook messenger get started button Postman screentshot Neha Creado The current format is, https://graph.facebook.com/v2.6/me

Facebook Messenger Bot - How to disable bot and allow human to chat

旧时模样 提交于 2019-12-04 02:55:09
so this is something I've been trying to think through for about 16 hours. I am coding with PHP / CuRl / etc - the bot works and everything is fine. My current issue is figuring out how to disable the bot and allow a human to begin chatting with the customer/sender. Has anyone successfully, created a route for this ? I mean it's pretty hard from what I see, you'd have to disable etc etc. A lot of effort for my clients. Thanks for any input. Facebook has rolled out a "Handover Protocol" which is supposed to facilitate a combined human/bot Messenger implementation. https://developers.facebook

Facebook Messenger API “URL COULD NOT BE VALIDATED”

拈花ヽ惹草 提交于 2019-12-04 00:08:30
I'm trying to setup the Facebook messenger API and I'm getting this error when I attempt to add the WebHook: The URL couldn't be validated. Callback verification failed with the following errors: curl_errno = 60; curl_error = SSL certificate problem: unable to get local issuer certificate; HTTP Status Code = 200; HTTP Message = Connection established I've setup my NodeJS server using the code they provided in the tutorial. Here's the url: https://stackoverload.me/chatter/webhook EDIT HERE'S THE RESOLUTION (someone wanted to see the code): var express = require('express'); var fs = require('fs'

How do I change facebook messenger bot webhook?

…衆ロ難τιáo~ 提交于 2019-12-03 09:18:12
I have successfully implemented a facebook bot. It's working fine. I was trying to change the webhook url now as I have to port it to a different server with a new domain. There is an option to change the events but I could not find and option to change the webhook. How do I change it? sabrina You can't edit the link directy from the "Messenger" product. On the left menu, after selecting your application, you have to click "+ add product" and add also webhooks. From webhooks then you can edit also messenger's webhook. To edit the webhook, click on Edit Subscription button on the page. Make

Facebook Chat Bot - How do I test the welcome message?

随声附和 提交于 2019-12-03 07:53:37
My chat bot is working great but I am having trouble debugging the Welcome message functionality because it only shows up when a conversation is initiated (although i'm pretty sure it's not working having tried it on a colleagues phone). How do I reset my chat so it sees me as a new user interacting with it? This is my welcome PHP Script at the moment <?php function webhook() { $challenge = $_REQUEST['hub_challenge']; $verify_token = $_REQUEST['hub_verify_token']; if ($verify_token === 'MYTOKEN') { echo $challenge; } $input = json_decode(file_get_contents('php://input'), true); $sender =

How does Facebook Messenger connect with Wit.ai Bot Engine?

时间秒杀一切 提交于 2019-12-03 07:50:27
问题 In Facebook's documentation they refer to wit.ai Bot Engine, but I can't find anywhere online where its explained how to connect the Story that you build in Wit with your Facebook Messenger App? 回答1: Wit.ai needs an input - user input. Sentence, phrase, word - to give you back the analysed results. So first when you say "your Facebook Messenger app" - you need to make sure you are handling the messenger part by itself: have a code in your language of preference running on the server\your

API authentication from a facebook messenger bot conversation

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 04:26:21
问题 What is the best way to authenticate with an external API from a conversation with a bot on the facebook messenger platform? For a broad example, I would like a user of my bot to create items on their own profiles of an external website. Is there a way to get login information from the user, or connect my bot to the external website, without the user explicitly sending a message to the bot with their username and password? What I found in the documentation under User Profile API: You can