Asp.net C# To get all incoming and outgoing calls

  • 1
  • Question
  • Updated 1 year ago

Is it possible to get the incoming and outgoing call logs for all users in your organization?

I am needing to get all incoming calls that were answered, and all outgoing calls for each users in our organization and show how many calls were made per day for the previous week along with a total count.

Is this possible with the API? I have downloaded the ringcentral-csharp-client-master project, but I do not know were to being or how to even connect to the api.

Any help would be great, even better a small sample app to show how to connect and pull back some log data.

Thanks,

Keith.

Photo of Keith Stephens Fax

Keith Stephens Fax

  • 150 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
If you don't need real time data, you can just fetch the call logs.

Do you any specific issues following the readme file?  https://github.com/ringcentral/ringcentral-csharp-client#installation
Photo of Keith Stephens Fax

Keith Stephens Fax

  • 150 Points 100 badge 2x thumb

I have 4 individual applications that should be connecting with RingCentral but they are giving me errors.

RingCentral-csharp-client-master application. The  public AuthorizeTest(RestClientFixture fixture) test job.

When I debug this test job I get the following error.
 FlurlHttpException: Request to https://platform.devtest.ringcentral.com/restapi/oauth/token failed with status code 400 (Bad Request).
 
 My test application.

Just want to get a successful connection. I followed the install instruction.

   RestClient rc = new RestClient("Key", "Secret", "https://platform.devtest.ringcentral.com");     
            rc.Authorize("Username", "", "password");
            var extension = rc.Restapi().Account().Extension();
            var callLogs = extension.CallLog().List(new { direction = "Inbound" });
            var account =  rc.Restapi().Account().Get();

I get the following for callLogs and account
 callLogs Id = 37, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"
account Id = 44, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"


Through Chromes PostMon application
https://medium.com/ringcentral-developers/using-postman-with-swagger-and-the-ringcentral-api-523712f...

Gives me the following error.

{
  "error": "unauthorized_client",
  "error_description": "Unauthorized for this grant type"
}


From the test pages on the Dev site.

http://ringcentral.github.io/api-explorer/#!/Account_and_Extension_Information/v1_0_account__account...

I am running the very 1st Post call under Authentication.

/oauth/token

{
  "error": "unauthorized_client",
  "error_description": "Unauthorized for this grant type" }

Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
For the 400 error, please catch the exception and print the response. https://github.com/tmenier/Flurl/issues/114 http://tmenier.github.io/Flurl/error-handling/

I think it is because you didn't setup the testing project: https://github.com/ringcentral/ringcentral-csharp-client/tree/master/RingCentral.Test#setup


For RingCentral-csharp-client application, all the http requests are async, so please don't treat them as sync. 

For example:  var account =  rc.Restapi().Account().Get();

should be change to either  var account =  await rc.Restapi().Account().Get();

or  var account =  rc.Restapi().Account().Get().Result;

If you treat them as sync and set a break point, you won't be able to see any data.