Mathieu Delvaux
Mathieu Delvaux

Reputation: 68

Messenger API Handover Pass Thread Control returning error 10 (2018171)

We've set up a bot, which features a persistent menu with the option for a user to switch the discussion to a human, by using the Handover Protocol.

This button sends a payload to DialogFlow, which then calls our web hook to post to the Messenger API the following function:

request({
    url: 'https://graph.facebook.com/v2.6/me/pass_thread_control',
    qs: { access_token: config.page_token },
    method: 'POST',
    json:{
      "recipient": {"id": userID},
      "target_app_id": 263902037430900
    }
  }, (error, res, body) => {
    if (error) {
      console.error('Error sending messages: ', error)
    } else if (res.body.error) {
      console.error('Error: ', res.body.error)
    }
  })

But the call returns the following error:

{  
  message:'(#10) Only available to Primary and Secondary Receivers',
  type:'OAuthException',
  code:10,
  error_subcode:2018171,
  fbtrace_id:'HUrgr45FGGC'
}

We can't figure out this error (which is undocumented).

Under the Page Settings, the bot is correctly set as the primary receiver, and the Inbox as secondary.

Has anyone else run into this?

Upvotes: 2

Views: 2155

Answers (1)

Thomas Hermine
Thomas Hermine

Reputation: 18

For those getting here via a Google Search : turns out if was a bug on Facebook API, which is now fixed.

➡️ https://developers.facebook.com/bugs/820116014857560

Upvotes: 0

Related Questions