API reference¶
-
class
Messenger
()¶ Messenger
-
Messenger.
pageSend
(pageId, recipientId, responseMessage)¶ Send a response to a user at a page. This is the long way of sending a message. You probably want to use shortcut
Response.reply()
instead.The SDK sets the messaging_type for all messages to
RESPONSE
because most users will only send messages in response to their users’ actions. While it’s possible to use the SDK to send other message types, setting anothermessaging_type
is currently unsupported.Arguments: - pageId (string) – Page ID
- recipientId (string) – Recipient ID
- responseMessage (Object) – The response message to send back
Returns: Promise – A promise for sending the response
-
Messenger.
send
(recipientId, responseMessage)¶ Send a response to the default page
Deprecated since version 1.4.0: Use
Response.reply()
insteadArguments: - recipientId (number) – Recipient ID
- responseMessage (Object) – The response message to send back
Returns: Promise – A promise for sending the response
-
Messenger.
start
()¶ Start the web server and listen for messages
Returns: void –
-