0

I'm working on a messenger bot and I have some trouble for the Get Started button...I work on node.js and I use Express framework. Here is what I did but still don't work:

function setupGetStartedButton(sender){
var messageData = {
        "get_started":[
        {
            "payload":"USER_DEFINED_PAYLOAD"
            }
        ]
}
request({
    url: 'https://graph.facebook.com/v2.6/me/messages',
    qs: {access_token:token},
    method: 'POST',
    json: {
        recipient: {id:sender},
        message: messageData,
    }
}, function(error, response, body) {
    if (error) {
        console.log('Error sending messages: ', error)
    } else if (response.body.error) {
        console.log('Error: ', response.body.error)
    }
})

}

Need help...And my skills on evaluated in a scale of 1 to 10, I'am 4.

1 Answers1

0

Try changing the URL to https://graph.facebook.com/v2.6/me/messenger_profile and your messageData to

{ 
  "get_started":{
    "payload":"GET_STARTED_PAYLOAD"
  }
}
sotirelisc
  • 392
  • 3
  • 14