Setup RingCentral to send-sms, receive IVR call notifications

  • 1
  • Question
  • Updated 2 years ago
Hi,

I am trying to use RingCentral APIs to send SMS messages and listen to IVR notifications.

I have been able to get auth-token from API explorer. But send-sms API is not working.
I have used "~+14136790083" and "~161055004" as accountId in RingCentral but I have been getting this error.

"errors": [ { "errorCode": "CMN-102", "message": "Resource for parameter [accountId] is not found", "parameterName": "accountId" }

Also, I have not been able to understand how exactly RingCentral IVR notifications work. I want to know where can I setup the IVR number for which if it is called my service will receive notifications.

Can someone please help me on send-sms and IVR notifications part.

Thanks,
Anshul
Photo of Anshul Goyal

Anshul Goyal

  • 160 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 6,978 Points 5k badge 2x thumb
"~+14136790083" and "~161055004" Seem like phone number instead of accountID.

Could you please post your code?
Photo of Tyler Long

Tyler Long, Official Rep

  • 6,978 Points 5k badge 2x thumb
I am getting "Authorization header is not specified" error.

This is because you skipped the authorization step. http://ringcentral-api-docs.readthedocs.io/en/latest/oauth/

You need to get a token first, then add it to your HTTP header: "Authorization: Bearer value-of-token"
(Edited)
Photo of Tyler Long

Tyler Long, Official Rep

  • 6,978 Points 5k badge 2x thumb
For the Ruby code you posted, could you please post the whole response? 
Photo of Anshul Goyal

Anshul Goyal

  • 160 Points 100 badge 2x thumb
response object for ruby code : 
=> {"uri"=>"https://platform.devtest.ringcentral.com/restapi/v1.0/account/161055004/extension/161055004/message-...;, "id"=>2736847004, "to"=>[{"phoneNumber"=>"+17737175653", "location"=>"Chicago, IL"}], "from"=>{"phoneNumber"=>"+14136790083", "location"=>"Otis, MA"}, "type"=>"SMS", "creationTime"=>"2017-03-02T07:14:42.000Z", "readStatus"=>"Read", "priority"=>"Normal", "attachments"=>[{"id"=>2736847004, "uri"=>"https://platform.devtest.ringcentral.com/restapi/v1.0/account/161055004/extension/161055004/message-...;, "type"=>"Text", "contentType"=>"text/plain"}], "direction"=>"Outbound", "availability"=>"Alive", "subject"=>"Test SMS using a RingCentral Developer account - Hi there! test message from Anshul", "messageStatus"=>"SendingFailed", "smsSendingAttemptsCount"=>1, "conversationId"=>3609730972937174755, "conversation"=>{"id"=>"3609730972937174755", "uri"=>"https://platform.devtest.ringcentral.com/restapi/v1.0/conversation/3609730972937174755"}, "lastModifiedTime"=>"2017-03-02T07:14:42.981Z"} 
(Edited)
Photo of Tyler Long

Tyler Long, Official Rep

  • 6,978 Points 5k badge 2x thumb
I don't see any issue in your code. Let me do some experiments myself and get back to you later.
Photo of Tyler Long

Tyler Long, Official Rep

  • 6,978 Points 5k badge 2x thumb
I can reproduce the issue with your credentials. However it's OK with my own credentials.

So I think there is something wrong with your account. Please send an email to devsupport@ringcentral.com for help.

By the way, could you please remove the credentials from the messages above? It's not a good idea to expose them.
(Edited)