通过 RingCentral REST 发送短信时出错 API

Error while sending SMS via RingCentral REST API

我一直在尝试通过 RingCentral REST 发送短信 API,但它向我发送了一个不完整的错误,无法解决。

我的要求JSON,

 {
  "to": [{
    "phoneNumber": "+xxxxxxxxxxx"
  }],
  "from": {
    "phoneNumber": "+xxxxxxxxxxx"
  },
  "text": "Test Text message from sample ringcentral app - test by Sandip"
}

RingCentral 错误响应,

{
  "errorCode": "InvalidParameter",
  "message": "Parameter [] value is invalid",
  "errors": [{
    "errorCode": "CMN-101",
    "message": "Parameter [] value is invalid",
    "parameterName": ""
  }],
  "parameterName": ""
}

我已经阅读了 RingCentral 开发者文档,我的要求 JSON 与那里提到的相同。我还检查了 RingCentral 错误代码文档,此错误代码指定无效参数,参数名称在 [] 括号中。我的响应错误中没有参数名称。我无法确定这里的问题。

{
  "to": [{
    "phoneNumber": "xxxxxxxxxxx"
  }],
  "from": {
    "phoneNumber": "xxxxxxxxxxx"
  },
  "text": "Test Text message from sample ringcentral app - test by Sandip"
}

不接受加号。您需要将其删除。

我已经解决了这个问题。我正在向 RingCentral 发出 PostAsJsonAsync() 调用 post JSON 请求。它似乎有一些问题。我将呼叫更新为 PostAsync(),现在可以使用了。