Twilio WhatsApp 用户名

Twilio WhatsApp username

我将 Twilio [当前沙盒] 用于 WhatsApp API。

当消息到达沙箱时,我post到webhook,我得到这样的数据: {"SmsMessageSid":"xxxxxxxxxx","NumMedia":"0","SmsSid":"xxxxxxxxxx","SmsStatus":"received","Body":"try1","To":"whatsapp:+14xxxxxxxxxx","NumSegments":"1","MessageSid":"xxxxxxxxxx","AccountSid":"xxxxxxxxxx","From":"whatsapp:+97xxxxxxxxxx","ApiVersion":"2010-04-01"}

有没有办法获取用户名?

发件人是 WhatsApp 用户名,您是指如何以编程方式提取用户名(如果是,是否有您使用的特定语言)?

"From":"whatsapp:+97xxxxxxxxxx

没有用户名,除非发件人通过邮件正文告诉您其用户名,否则您将获得的只是发送消息的用户的编号,即 "From" 值。

WhatsApp Facebook API 负载中确实有一个名称:

{
  "contacts": [ {
    "profile": {
        "name": "Kerry Fisher"
    },
    "wa_id": "16315551234"
  } ],
  "messages":[{
    "from": "16315551234",
    "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
    "timestamp": "1518694235",
    "text": {
      "body": "Hello this is an answer"
    },
    "type": "text"
  }]
}

来源:https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound

与 Twilio 交谈后,我的团队得到了以下回复:

Twilio does not manage a user database. Although this is a data variable on the WhatsApp API, we are not leveraging it immediately as it is not mandatory from the WhatsApp docs and our data structure may not fully support this yet.

Again the Beta Nature of the Product will unveil product needs and features in which we have not moved forward with how or if we plan to support this.

据我所知,至少有一家提供此功能的提供商。

对我来说,Twilio 似乎回收了他们为 SMS 使用的所有架构,没有任何缺点。我们刚找到一个,消息负载中缺少 WhatsApp 用户名。

我联系了 Twilio 询问此功能的截止日期,但直到现在我还没有收到任何消息。