question

RM avatar image
RM asked RM answered

New to RingCentral and API,new to RingCentral and API

I'm trying to determine where to start. I have read a few post on here, read the API reference and Developers Guide on rigncentral.com.

https://developers.ringcentral.com/guide/voice/call-log/reading-call-log

What I'm trying to accomplish is "download the call log" so it can be uploaded or loaded into the data warehouse for long term keeping and reporting.

With that said I was trying to test the API calls just as a test in Fiddler. just to get my feet wet.

But

1. I did create an "app" on the sandbox.

2. Don't know if the sandbox has calls to query? I sure didn't create any calls, I don't know how. Is it possible to have "test data" or able to query the production call logs?

3. As a simple test in Fiddler I was sending

Get https://platform.devtest.ringcentral.com/restapi

with the header of

accept: 'application/json'

authorization: Bearer 'encrypted string here'

Host: platform.devtest.ringcentral.com

but my response I get is

[Fiddler] The connection to 'platform.devtest.ringcentral.com' failed. <br />System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https&gt; HTTPS handshake to platform.devtest.ringcentral.com (for #249) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. &lt; An existing connection was forcibly closed by the remote host

So I don't know if I need to get auth first or how to do that?


Is there a developers guide that "walks" you through the needed steps and what they are?

Also does anyone know how to get Fiddler or any other "API test" app to just make a few test API calls and see what it response is.


I tried to call the Call API with the https://developers.ringcentral.com/api-reference/Call-Log/readCompanyCallRecord

but since I may not have any calls it doesn't return anything. Again how can I get the sandbox with call data?


,

I'm trying to determine where to start. I have read a few post on here, read the API reference and Developers Guide on rigncentral.com.

https://developers.ringcentral.com/guide/voice/call-log/reading-call-log

What I'm trying to accomplish is "download the call log" so it can be uploaded or loaded into the data warehouse for long term keeping and reporting.

With that said I was trying to test the API calls just as a test in Fiddler. just to get my feet wet.

But

1. I did create an "app" on the sandbox.

2. Don't know if the sandbox has calls to query? I sure didn't create any calls, I don't know how. Is it possible to have "test data" or able to query the production call logs?

3. As a simple test in Fiddler I was sending

Get https://platform.devtest.ringcentral.com/restapi

with the header of

accept: 'application/json'

authorization: Bearer 'encrypted string here'

Host: platform.devtest.ringcentral.com

but my response I get is

[Fiddler] The connection to 'platform.devtest.ringcentral.com' failed. <br />System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https&gt; HTTPS handshake to platform.devtest.ringcentral.com (for #249) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. &lt; An existing connection was forcibly closed by the remote host

So I don't know if I need to get auth first or how to do that?


Is there a developers guide that "walks" you through the needed steps and what they are?

Also does anyone know how to get Fiddler or any other "API test" app to just make a few test API calls and see what it response is.


I tried to call the Call API with the https://developers.ringcentral.com/api-reference/Call-Log/readCompanyCallRecord

but since I may not have any calls it doesn't return anything. Again how can I get the sandbox with call data?


getting started
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban avatar image
Anirban answered

I found some below reference where it seems Fiddler have issues in connecting SSL system:

https://stackoverflow.com/questions/44141255/fiddler-4-6-cannot-connect-to-strong-ssl

https://developers.de/2018/08/30/fiddler-tls-issues/

Could you please check once

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

RM avatar image
RM answered Phong Vu commented

ok thanks for the reply and I will check out the articles.

But is there another way to test the API calls from another app? I know I can test with the API explore in RingCentral.

3 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Anirban avatar image Anirban commented ·

Try from postman client

0 Likes 0 ·
RM avatar image RM Anirban commented ·

I got postman to work. But now I need help with the other questions or comments from my original post. How can I get sandbox data?

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ RM commented ·

Open this link and download the RC Phone app for Desktop. Switch it to sandbox mode and use it to make test calls to generate call log data.

Switch mode:

MacOS: fn + command + f2

Windows: ctrl + F2

screen-shot-2021-04-12-at-23555-pm.png

0 Likes 0 ·
RM avatar image
RM answered RM commented

I'm finally getting somewhere with Postman but now I'm getting an error calling the oauth API

I'm using this as reference

Example 1: Phone number as a username

Request

POST /restapi/oauth/token HTTP/1.1 
Accept: application/json 
Content-Type: application/x-www-form-urlencoded 
Authorization: Basic cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ== 
grant_type=password&username=18559100010*123&password=121212


here is my call

https://platform.devtest.ringcentral.com/restapi/oauth/token?grant_type=password&username=<phone number from sandbox>&password=<password for user in sandbox>

header

Authorization: Basic <enter encoded string for client id and client secret from sandbox>

Accept: application/json

Content-Type: application/x-www-form-urlencoded


response

{

"error": "invalid_grant",

"errors": [

{

"errorCode": "OAU-140",

"message": "Invalid resource owner credentials"

}

],

"error_description": "Invalid resource owner credentials"

}


I have reset the password for my user. I'm able to login into the https://login.devtest.ringcentral.com/

with the user name and password


I don't know what could be causing the issue and I can't figure out how to log into rincentral.com and run the API explore in the sandbox as that user.

10 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

What is your app client id?

0 Likes 0 ·
RM avatar image RM Phong Vu ♦♦ commented ·

why do u need my client id?

I took the client id and client secret and encoded them like the directions stated. Using a : to be place between them.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ RM commented ·

Why? Because I need to see if your app type is correct. Also, if this "cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ==" is the actual basic encoded string of your client id and client secret, then you screwed up with the encoding.

0 Likes 0 ·
Show more comments
Anirban avatar image Anirban commented ·

This should be separate: https://platform.devtest.ringcentral.com/restapi/oauth/token

and this should be in body: grant_type=password&username=<phone number from sandbox>&password=<password for user in sandbox>

Content-Type: application/x-www-form-urlencoded

0 Likes 0 ·
RM avatar image RM Anirban commented ·

in postman when I place grant_type in the body (using the body tab) it gives the error of

{

"error": "invalid_request",

"errors": [

{

"errorCode": "OAU-250",

"message": "Unsupported grant type"

}

],

"error_description": "Unsupported grant type"

}

but when I pass it in as a param (using Params tab) it gives the other error

0 Likes 0 ·
Anirban avatar image Anirban RM commented ·

Hope this helps

1618346990122.png

0 Likes 0 ·
1618346990122.png (49.5 KiB)
Show more comments
RM avatar image
RM answered

Ok so I got the "App" to graduate to production. But know I'm confused on what user to use to make the calls. On the sandbox under the Apps -> credentials screen there is

user name - which is a phone number

password - which was created and I can reset it.


but for production I only see the user name as a phone number (different phone number / username then the sandbox) but no password. I can't set the password neither as the column is set to N/A.


So to make the API calls that I was making in the Sandbox how can I do that in Prod? As in the sandbox I would call restapi/oauth/token with the user name and password.


1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys