Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user_ref in Structured Message #97

Open
zewlak opened this issue Apr 25, 2017 · 4 comments
Open

user_ref in Structured Message #97

zewlak opened this issue Apr 25, 2017 · 4 comments

Comments

@zewlak
Copy link

zewlak commented Apr 25, 2017

Is it possible to send Structured Message to recipient:user_ref instead of recipient:id?
There is no way to pass user_ref param to Structured Message. Maybe a new public method setUserRef in Message class would do the job (for now)? It would also cover this problem for another Message types like ImageMessage, QuickReply etc.

What do you think?

@wittfabian
Copy link
Contributor

Please provide a link to the documentation.

@zewlak
Copy link
Author

zewlak commented Apr 25, 2017

Sadly it's undocumented that you can send rich messages to user_ref but I tested it and works fine.

Sending to user_ref is described only here in last paragraph (Calling the Send API)
https://developers.facebook.com/docs/messenger-platform/plugin-reference/checkbox-plugin

@wittfabian
Copy link
Contributor

recipient with user_ref is only for the first call.

After you receive the callback event, you can call the Send API to start messaging the user using the user_ref identifier in recipient as shown below. Note that this field is the same as the unique user_ref param used before when the plugin was rendered and in confirming the opt-in.

If the call to the Send API is successful, the response will contain a recipient_id parameter, which is a stable user ID that you can now use in future API calls.

@zewlak
Copy link
Author

zewlak commented Apr 25, 2017

That's right but response is sent after first user interaction with message sent in first call. I'm sending Message with Buttons in first call to increase response rate. Like below:

tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants