function callSendAPI()

in server-examples/nodejs-bot/bot.js [130:144]


  function callSendAPI (messageData) {
    var graphApiUrl = 'https://graph.facebook.com/me/messages?access_token=' + process.env.PAGE_ACCESS_TOKEN;
    request({
      url: graphApiUrl,
      method: 'POST',
      json: true,
      body: messageData
    }, function (error, response, body) {
      console.error(
        'Send api returned error', error,
        'Status code', response.statusCode,
        'Body', body
      );
    });
  }