【问题标题】:twilio API issues when submitting whastapp query提交 wastapp 查询时的 twilio API 问题
【发布时间】:2021-01-01 21:01:31
【问题描述】:

我正在使用 HttpURLConnection 发帖到https://api.twilio.com/2010-04-01/Accounts/****/Messages.json

这适用于 SMS - 但是当 txtTo 和 txtFrom 更改为 To=whatsapp:+12345567&From=whatsapp:+123456778&Body=sacsacsac

它停止工作......有什么想法吗?

String message  = "To=" + txtTo + "&From=" + txtFrom + "&Body=" + txtBody;

byte[] postData = message.getBytes( StandardCharsets.UTF_8 );

【问题讨论】:

    标签: twilio-api


    【解决方案1】:

    字符串消息 = "From=" + URLEncoder.encode("whatsapp:" + txtFrom, "UTF-8") +"&Body=" + URLEncoder.encode(txtBody, "UTF-8") + "&To= " + URLEncoder.encode("whatsapp:" + txtTo, "UTF-8");

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多