简体   繁体   中英

Error while sending SMS via RingCentral REST API

I have been trying to send SMS by RingCentral REST API, but it sends me an incomplete error, which can't be resolved.

My Request JSON,

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

RingCentral error response,

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

I have gone through RingCentral developer docs, my request JSON is the same as mentioned there. Also I have checked RingCentral error code doc, this error code specifies invalid parameter with parameter name in [] brackets. My response error has no parameter name in it. I am unable to identify problem here.

I have resolved the issue. I was making a PostAsJsonAsync() call to post JSON request to RingCentral. It appears to have some issues with it. I updated my call to PostAsync() and it works now.

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

The plus sign is not accepted. You need to remove it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM