Weird error with Facebook Messenger Platform/bot Welcome Confugration

后端 未结 4 1851
孤独总比滥情好
孤独总比滥情好 2021-02-05 10:35

I\'m getting a weird error while configuring welcome message for my Messenger bot. I\'ve been using the same code (as shown below) and it has just been working fine until last n

4条回答
  •  -上瘾入骨i
    2021-02-05 10:43

    I get the same issue and fix it. I think your json of request is

    let messageData = {
    "setting_type":"call_to_actions",
    "thread_state":"new_thread",
    "call_to_actions":[
      {
        "payload":"welcome_payload"
      }
    ]
    }
    request({
        url: 'https://graph.facebook.com/v2.6/me/thread_settings',
        qs: {access_token:token},
        method: 'POST',
        json: {
            messageData
        }
    }
    

    but it will not work and log will say you have no "setting_type" = =a try this one

      request({
            url: 'https://graph.facebook.com/v2.6/me/thread_settings',
            qs: {access_token:token},
            method: 'POST',
            json: {
                setting_type:"call_to_actions",
                thread_state:"new_thread",
                 call_to_actions:[
                  {
                    "payload":"welcome_payload"
                  }
                 ]
            }
        }
    

    it work for me.

提交回复
热议问题