Ejemplo n.º 1
0
        public async void RecordingContent()
        {
            using (var rc = new RestClient(
                       Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_ID"),
                       Environment.GetEnvironmentVariable("RINGCENTRAL_CLIENT_SECRET"),
                       Environment.GetEnvironmentVariable("RINGCENTRAL_SERVER_URL")
                       ))
            {
                await rc.Authorize(
                    Environment.GetEnvironmentVariable("RINGCENTRAL_USERNAME"),
                    Environment.GetEnvironmentVariable("RINGCENTRAL_EXTENSION"),
                    Environment.GetEnvironmentVariable("RINGCENTRAL_PASSWORD")
                    );

                var account = rc.Restapi().Account();

                // List call Logs
                var queryParams = new ReadCompanyCallLogParameters
                {
                    type          = new[] { "Voice" },
                    view          = "Detailed",
                    dateFrom      = DateTime.UtcNow.AddDays(-365).ToString("o"),
                    withRecording = true,
                    perPage       = 10
                };
                var callLogs = await account.CallLog().List(queryParams);

                if (callLogs.records.Length > 0)
                {
                    // download a call recording
                    var callLog = callLogs.records[0];
                    if (callLog.recording != null)
                    {
                        var content = await account.Recording(callLog.recording.id).Content().Get();

                        Assert.NotNull(content);
                        Assert.True(content.Length > 0);
                        File.WriteAllBytes("test.wav", content);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Operation: Get Company Call Log Records
 /// Http Get /restapi/v1.0/account/{accountId}/call-log
 /// </summary>
 public async Task <RingCentral.AccountCallLogResponse> List(ReadCompanyCallLogParameters queryParams = null)
 {
     return(await rc.Get <RingCentral.AccountCallLogResponse>(this.Path(false), queryParams));
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Returns call log records filtered by parameters specified.
 ///     HTTP Method: get
 ///     Endpoint: /restapi/{apiVersion}/account/{accountId}/call-log
 ///     Rate Limit Group: Heavy
 ///     App Permission: ReadCallLog
 ///     User Permission: FullCompanyCallLog
 /// </summary>
 public async Task <AccountCallLogResponse> List(ReadCompanyCallLogParameters queryParams = null,
                                                 RestRequestConfig restRequestConfig      = null)
 {
     return(await rc.Get <AccountCallLogResponse>(Path(false), queryParams, restRequestConfig));
 }