I am trying to build a messenger bot. I verified a token and linked a page to the bot app. Now the problem is whenever I send a message to the page, the server is getting a JSON response with a "LIKE" message and no message text.
{'object': 'page',
'entry':
[{'time': 1490417055475,
'messaging':
[{'message': {'mid': 'mid.$cAALh2oap5fFhMxj3m1bAdOuaPgvd', 'sticker_id': 369239263222822,
'attachments':
[{'payload': {'sticker_id': 369239263222822, 'url': 'https://scontent.xx.fbcdn.net/v/t39.1997-6/851557_369239266556155_759568595_n.png?_nc_ad=z-m&oh=65f8806bcfe45834eb50b60f51cb352d&oe=596142DC'}, 'type': 'image'}], 'seq': 57831},
'sender': {'id': '1311257182278227'}, 'recipient': {'id': '768737829931919'}, 'timestamp': 1490384301979}], 'id': '768737829931919'}]}
Has anybody experienced this before? I am completely stuck because of this behavior from messenger API.
I'm going out on a limb here because there isn't very much information in the question.
That message isn't a "LIKE" message. It is an image message that is created by someone (OP) clicking, tapping or click-hold/tap-hold the thumbs up button in the chat input area.
What may be happening is that you originally send a thumbs up to the chatbot and your app answered with something other than a 200 HTTP response. When this happens, facebook waits and sends the response (in this case the thumbs up) in about a minute. If there is another non-200 response, it will repeat.
If I'm right, a solution would be to just swallow the error (if you have exceptions in your programming language, just rescue and move on) and respond with a 200.
This should make Facebook think you're good to go and they will deliver all the backed up messages after the positive ressponse. Then remove the error swallowing and you should be receiving messages as they are sent from Facebook, unless you are erroring out again.
Related
As per https://core.telegram.org/bots#deep-linking
I have crafted a deep linking start URL
http://t.me/<my_bot>?start=token
When i enter this into my iOS safari browser it redirects to telegram, but the param is missing.
I see a start button, but when clicked it is just '/start' with no supplementary part where the should be.
I'm expecting to receive
"start " as the message text on the webhook update.
Does anybody know why the param would be missing?
Thanks
Sorry I don't have enough points to add a comment to your question, just wanted to tell you it doesn't work with Android too.
Ok, so it happens the mobile app (either Android or iOS) shows /start but actually sends /start token to the bot, where token is whatever you put after ?start=. Check your bot incomming messages.
I've encountered a weird situation, after registration we're sending an email with a verification link, pretty standard stuff, but somehow clicking on the link seems to make the request twice, looking at the logs, the first time it comes from my IP and the second request comes from some Google IP: 66.102.8.60 (doing a reverse lookup shows google-proxy-66-102-8-60.google.com).
Any idea what's going on and how to prevent this?
The server is running Nginx and the site is Ruby on Rails if that helps.
I do not know the root cause but my best guess is same as Tripleee wrote above - most probably google is scanning urls. This happens in all browsers (well at least in Chrome and Firefox), but only under following circumstances:
the url is clicked from gmail (if you copy paste it to browser tab, the second request is not issued)
the url is clicked for the first time... Subsequent clicks from the same email do not trigger second request
I know it is probably not the answer you expected, but after giving it some thought I figured that operation like this should be handled on server side. In my case I am tracking information about confirmation urls anyways, so the first time the request comes to my backend I am deleting it and proceeding with confirmation normally. Since the confirmation entry is missing in the database for the second request it returns immediately with status 404, 422 or something whatever suits you.
Hope that helps anyone who gets here looking for an answer to this problem ;)
I am integrating Woo-commerce API’s in my wordpress site using Woo-commerce official rest sdk. I made a link using authentication endpoint URL. When I click the link it takes the user to Woo-commerce authentication page, where user login and Approve the request.
After approving the request it should take me to return url which i mention in the link. Instead it shows me the following error.
Error: An error occurred in the request and at the time were unable to send the consumer data.
I was having the same issue as well, and in my case, the return_url on my backend server was accepting GET requests, I changed it to POST, and everything worked perfectly. I hope it helps!
I know it's late for the answer but writing it for the people who will face the same issue in the future.
I was having the same issue and my problem was that the callback_url was wrong which was creating the error internally. So if you are getting this error, most probably your callback_url is not correct, please check that properly.
For whoever Shattique's answer
did not work,
check the response status code sent by the callback_url handler.
Anything other than 200 will throw the error in OP's question.
Here is link to woocommerce github repo,
where it throws the error.
TLDR: Make sure callback_url handler returns statusCode: 200
We have created an application to send out bulk emails using AWS SES. We are able to send out the emails and track the metrics like Opens, Clicks etc using AWS SNS successfully. The only problem we have is that in the "Opens" object that SNS is sending, it is always returning the same value "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)". What we are looking at is to determine where the email is opened like Mobile/Tab/Desktop and in which browser. Even when the email is opened in Chrome, it is returning as Mozilla. Any help/suggestion in this regard is highly appreciated.
Additional Info: I figured out that the userAgent is being correctly returned in "clicks" object. But not in the "Open" object. Not sure why. We would like to track the same information when the email is opened also as not all the recipients click on a link.
There isn't actually a way to determine that a message has been opened.¹ Detecting "opens" relies on detection of the viewer fetching an image embedded in the message when the mail is "opened."
At the bottom of each message, we insert a 1 pixel by 1 pixel transparent GIF image. Each email includes a unique link to this image file; when the image is opened, we can tell exactly which message was opened and by whom.
When the viewer is Gmail, the user's browser doesn't fetch this image.
https://aws.amazon.com/blogs/messaging-and-targeting/open-and-click-tracking-have-arrived/
When a message is opened in gmail, the user's browser doesn't fetch the image directly, it fetches it from the google image proxy, and the image proxy fetches it from SES and generates the tracking event. Hence, (via ggpht.com GoogleImageProxy).
This isn't something that you have control over, as the sender.
The proxy can identify itself by saying whatever it likes in the User-Agent field -- there is no reason to believe that the entire user-agent string isn't being created by the proxy. Google searching the topic seems to confirm that this is how the proxy always appears. Mozilla/5.0 is a generic user agent string, that does not mean anything more than "I am some kind of web browser, or want the server to believe that I am."
¹there isn't actually a way... well, technically, there is, but thanks to the widespread profusion of spam, this standard is almost never applied to Internet mail. As noted in RFC-8098, "The presence of a Disposition-Notification-To header field in a message is merely a request for an MDN. The recipients' user agents are always free to silently ignore such a request." This is almost always what happens... nothing.
I am a new member.
I have an error when send message using HTTP Post to "graph.facebook.com/v2.11/me/messages?access_token=MY_PAGE_TOKEN"
This is error return:
`{"error":{"message":"(#100) Tried accessing nonexisting field (messages) on node type (Page)","type":"OAuthException","code":100,"fbtrace_id":"EB39Xkxnf6O"}}`
Despite error, tester and developer still able to receive message. But the FB viewer might not and they not approve my review submission:
"We did not receive an automated response when we messaged your Page. Bots should respond to all input from the user within 30 seconds so that the experience feels like a continuous conversation. Please ensure that your experience is functional before you resubmit."
The log show same error with FB viewer when server trying to response.
Any help. Thanks a lot
As the documentation explains you are required to submit a {conversation-id} before the messages.
More info here