【问题标题】:Facebook Messenger, Temporary send message failure when sending receiptFacebook Messenger,发送回执时临时发送消息失败
【发布时间】:2016-04-20 15:56:43
【问题描述】:

我想将带有虚拟数据的收据发送给用户。

我使用this library,它简化了向 Facebook 发送消息的过程。

我的payload结构是这样的:

var payload = {
    template_type: 'receipt',
    recipient_name: '@' + user.name + ' ' + user.surname,
    order_number: (new Date).getTime(),
    currency: 'USD',
    payment_method: 'Наличными',
    order_url: 'http://www.example.com',
    timestamp: (new Date).getTime() + '',
    elements: [
        {
            title: title,
            subtitle: subtitle,
            quantity: 1,
            price: 20,
            currency: 'USD',
            image_url: image_url
        }
    ],
    address: {
        street_1:"Nurly tau",
        street_2:"",
        city:"Almaty",
        postal_code:"050000",
        state:"KZ",
        country:"KZ"
    },
    summary: {
        subtotal: 20,
        shipping_cost: 0,
        total_tax: 0,
        total_cost: 20
    },
    adjustments: []
};

我刚刚用简单的虚假数据填写了收据字段。此外,Facebook 会跟踪所有已发送回执中 order_numbers 的唯一性。

当我尝试发送此收据时,我收到一条错误消息:

{ message: '(#1200) Temporary send message failure. Please try again later',
  type: 'OAuthException',
  code: 1200,
  fbtrace_id: 'BHmHRCEQUC4' }

这个错误是什么意思? Facebook 的错误信息如此神秘?

【问题讨论】:

    标签: javascript node.js facebook facebook-messenger


    【解决方案1】:

    我只是遇到了同样的问题,经过一番摆弄后我想通了!问题是,当您使用(new Date).getTime() 构造时间戳时,它会返回自纪元以来的毫秒 量。但是,Facebook 要求它在几秒钟内完成。

    【讨论】:

    • 即你应该通过类似parseInt(((new Date).getTime())/1000).toString()
    • 我遇到了同样的问题,但我没有向 callSendAPI() 发送任何时间戳
    【解决方案2】:

    我遇到了同样的问题,经过多次尝试,我发现问题出在 JSON 有效负载传递的 timestamp 参数上。

    我不知道它可能是什么,但它对我有用。 (也许,时间戳应该在 API 调用之前,我不知道)。

    【讨论】:

    • 哇。同样在这里。我很高兴找到了这个。我会一直在摆弄这个。
    猜你喜欢
    • 2016-08-11
    • 1970-01-01
    • 2021-05-04
    • 2019-05-02
    • 2016-08-06
    • 1970-01-01
    • 2017-06-04
    • 1970-01-01
    • 2016-09-06
    相关资源
    最近更新 更多