Skip to content

Instantly share code, notes, and snippets.

@IbrahimTareq
Created June 17, 2018 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IbrahimTareq/70be9b80b1ec3bec1a4dd33beae7c570 to your computer and use it in GitHub Desktop.
Save IbrahimTareq/70be9b80b1ec3bec1a4dd33beae7c570 to your computer and use it in GitHub Desktop.
Code snippet on how to send message to a user with your Facebook page using the MessageMedia Conversations Node.js SDK.
const lib = require('messagemedia-conversations-sdk');
// Configuration parameters and credentials
lib.Configuration.basicAuthUserName = "API_KEY"; // The username to use with basic authentication
lib.Configuration.basicAuthPassword = "API_SECRET"; // The password to use with basic authentication
var controller = lib.AppUsersController;
var appUserId = 'appUserId';
var message = new BaseMessageDto({"key":"value"});
controller.createSendMessage(appUserId, message, function(error, response, context) {
console.log(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment