I want to use the ring-out restful api. I can get a token but get error calling api
Tags: getting started
Apr 3, 2018 at 9:51am • 4 replies • 0 likes
tim-martin
I want to use the ring-out restful API. I have written the code to successfully return a access token, but when I take the token and call the ring-out api I get the reasonphrase "Not Found"
this is what my url looks like:
'https://platform.devtest.ringcentral.com/restapi/v1.0/account/%2b+13136366191/extension/101/ring-out'
and my json I post:
{\"from\": {\"phoneNumber\": \"+13136366191\", \"forwardingNumberId\": \"\"}, \"to\": {\"phoneNumber\": \"+17134178892\", \"callerid\": \"\"}, \"playPrompt\": true, \"country\": { \"id\" : \"\" } }
Not sure what I am doing wrong.
I can share code if need be.
Thank you in Advance
4 Answers
Sorry I am just now getting back to this, but what do you mean internal IDs, main phone number and extension?
The app I created is a server only app and I am attempting to force a call via our CRM (click to call application). I have tried every thing i can think of. this is my latest attempt.
Json
{"from":{"phoneNumber":"+17134178892"},"to":{"phoneNumber":"+17132753591"},"playPrompt":true}
Request
{Method: POST, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
{
Accept: application/json
Authorization: Bearer U0pDMTFQMDFQQVMwMHxBQUNPS09XNS1IYTlMQ1dQRnBjbC0zc3dxbkx1QlVFVlJBY24tdmg1QVpKV0ZmbW13V2Q4elNReTJNc1dHSUNLMG5SNF9QWWRPMEVYNEhPV3FzbEwwTUtuTXExWklRMzhUcm84RWFEc3FFZ0lVRkl6Z2RaZzc5RDE4Z1hnZGxLX0M4amZVc194TDlMd1FSbFg2Z29OZ2NhWEtYelBCdEJqd2swbm1UbmNfSmhmNnZaZTZYVTZ6LVRLM1paODIwY09EQ2N8eWxWN3l3fHFRcXhrYjJXd0ZoV3JSNEU4bS03NGc
Content-Type: application/json; charset=utf-8
Content-Length: 110
}}
Response
{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: keep-alive
RCRequestId: 9a579238-3d8a-11e8-8369-005056bb594d
RoutingKey: SJC11P01PAS02
X-Rate-Limit-Group: heavy
X-Rate-Limit-Limit: 10
X-Rate-Limit-Remaining: 9
X-Rate-Limit-Window: 60
Date: Wed, 11 Apr 2018 13:16:54 GMT
Server: nginx/1.10.2
Content-Length: 236
Content-Language: en-US
Content-Type: application/json; charset=UTF-8
}}
Again, i can get my token using grant type = password without any problem. I just can't seem to get the ring-out to work
Is there any thing that should be running on my desktop, link Ring Central for windows?
Thank you again and I appreciate your thoughts and ideas.
Tim Martin
The app I created is a server only app and I am attempting to force a call via our CRM (click to call application). I have tried every thing i can think of. this is my latest attempt.
Json
{"from":{"phoneNumber":"+17134178892"},"to":{"phoneNumber":"+17132753591"},"playPrompt":true}
Request
{Method: POST, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
{
Accept: application/json
Authorization: Bearer U0pDMTFQMDFQQVMwMHxBQUNPS09XNS1IYTlMQ1dQRnBjbC0zc3dxbkx1QlVFVlJBY24tdmg1QVpKV0ZmbW13V2Q4elNReTJNc1dHSUNLMG5SNF9QWWRPMEVYNEhPV3FzbEwwTUtuTXExWklRMzhUcm84RWFEc3FFZ0lVRkl6Z2RaZzc5RDE4Z1hnZGxLX0M4amZVc194TDlMd1FSbFg2Z29OZ2NhWEtYelBCdEJqd2swbm1UbmNfSmhmNnZaZTZYVTZ6LVRLM1paODIwY09EQ2N8eWxWN3l3fHFRcXhrYjJXd0ZoV3JSNEU4bS03NGc
Content-Type: application/json; charset=utf-8
Content-Length: 110
}}
Response
{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: keep-alive
RCRequestId: 9a579238-3d8a-11e8-8369-005056bb594d
RoutingKey: SJC11P01PAS02
X-Rate-Limit-Group: heavy
X-Rate-Limit-Limit: 10
X-Rate-Limit-Remaining: 9
X-Rate-Limit-Window: 60
Date: Wed, 11 Apr 2018 13:16:54 GMT
Server: nginx/1.10.2
Content-Length: 236
Content-Language: en-US
Content-Type: application/json; charset=UTF-8
}}
Again, i can get my token using grant type = password without any problem. I just can't seem to get the ring-out to work
Is there any thing that should be running on my desktop, link Ring Central for windows?
Thank you again and I appreciate your thoughts and ideas.
Tim Martin
0
https://platform.devtest.ringcentral.com/restapi/v1.0/account/%2b+13136366191/extension/101/ring-out
In the uri above, account ID and extension ID are invalid. They should be internal IDs. Or you can use "~" to indicate the current account and extension: https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out'
In the uri above, account ID and extension ID are invalid. They should be internal IDs. Or you can use "~" to indicate the current account and extension: https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/ring-out'
0
Tim,
please read this to understand better how resources are addressed in our REST API: https://developer.ringcentral.com/api-docs/latest/index.html#!#Resources.html
Your mistake is the way how you are referring to account and extension in URI. You should use internal ID or tilde, not phone number/extension number.
please read this to understand better how resources are addressed in our REST API: https://developer.ringcentral.com/api-docs/latest/index.html#!#Resources.html
Your mistake is the way how you are referring to account and extension in URI. You should use internal ID or tilde, not phone number/extension number.
0
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder