RingCentral.Net 6.2.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package RingCentral.Net --version 6.2.5                
NuGet\Install-Package RingCentral.Net -Version 6.2.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RingCentral.Net" Version="6.2.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RingCentral.Net --version 6.2.5                
#r "nuget: RingCentral.Net, 6.2.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RingCentral.Net as a Cake Addin
#addin nuget:?package=RingCentral.Net&version=6.2.5

// Install RingCentral.Net as a Cake Tool
#tool nuget:?package=RingCentral.Net&version=6.2.5                

RingCentral.Net

Build Status Code Document

Getting help and support

If you are having difficulty using this SDK, or working with the RingCentral API, please visit our developer community forums for help and to get quick answers to your questions. If you wish to contact the RingCentral Developer Support team directly, please submit a help ticket from our developer website.

Additional resources

  • RingCentral API Reference - an interactive reference for the RingCentral API that allows developers to make API calls with no code.
  • Document - an interactive reference for the SDK code documentation.

Installation

Packages are available on NuGet. You can install them just like you install any other NuGet packages.

This package is compatible with .NET Standard 2.0, which means, it is compatible with all modern .NET platforms including .NET Core, .NET Framework, and Mono.

Extensions

Since version 5.0.0, this project has been changed to an extension-based architecture.

You need to install extensions if you need extra features:

Code samples

You can find sample code for all the endpoints.

There is also lots of useful code for your reference in our test cases.

Logging

The SDK takes advantage of System .Diagnostics.Trace](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.trace?view=net-6.0) to provide logs.

To enable logging, you need to either add #define TRACE to your source or specify the option /d:TRACE when compiling.

To specify an output channel, you need to specify a listener:

Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));

Code about will print logs to the console. For more detail please refer to Trace.Listeners Property.

Demo project.

C# using statement

Please note that if you use the using statement to initialize a RestClient:

using (var rc = new RestClient("clientID", "clientSecret", "serverURL"))
{
    await rc.Authorize("username", "extension", "password");
    ...
}

rc.Dispose() will be automatically invoked after the code block above and the token will be revoked.

If you want to retain the token, do NOT use using and do not rc.Revoke().

Binary content downloading

Some sample code for binary content downloading may not work.

Because RingCentral is gradually migrating binary content to CDN such as media.ringcentral.com.

For example, to download the attachment of a fax:

// `message` is the fax message object
var content = await rc.Get<byte[]>(message.attachments[0].uri);

The following does NOT work:

// `message` is the fax message object
var content = await rc.Restapi().Account().Extension().MessageStore(message.id).Content(message.attachments[0].id).Get();

Rule of thumb

But not all binary content has been migrated to CDN. If the resource to download provides you with a CDN URI, use that CDN URI. If there is no CDN URI provided, construct the URI as the sample code shows.

How to access headers

By default, the SDK doesn't return headers:

var extInfo = await rc.Restapi().Account("~").Extension("~").Get();

If you need headers:

var httpResponseMessage = await rc.Get(rc.Restapi().Account("~").Extension("~").Path(true));
var headers = httpResponseMessage.Headers;
var responseBodyStr = await httpResponseMessage.Content.ReadAsStringAsync();
var extInfo = JsonConvert.DeserializeObject<GetExtensionInfoResponse>(responseBodyStr);

Release Notes

6.0.0

We have renamed all "glip" to "team-messaging". For example:

rc.Restapi().Glip().Chats().List();

Becomes:

rc.TeamMessaging().Chats().List();

For maintainers

Release

Update the version number in RingCentral.Net/RestClient.cs.

Update version number in <ProjectName>/<ProjectName>.csproj

cd <ProjectName>
dotnet pack

Todo

  • Add batch get to auto-generated sample code
  • Add icons to NuGet packages

Development Notes

I tried to migrate from Newtonsoft.Json to System.Text.Json, but it's not easy. Especially System.Text.Json doesn't automatically convert string to number. It doesn't even automatically convert double to int64. Considering the complexity and benefits of the migration, I decided to keep using Newtonsoft.Json for now. Ref: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/migrate-from-newtonsoft

Code coverage

Install the following globally if you haven't done so:

dotnet tool install -g dotnet-reportgenerator-globaltool

Collect code coverage data

dotnet test -settings RingCentral.Tests/coverlet.runsettings.xml

The result is located in RingCentral.Tests/TestResults/

Generate report

~/.dotnet/tools/reportgenerator -reports:"RingCentral.Tests/TestResults/239bdb87–151b-42ac-acec-1f604f8c02c5/coverage.cobertura.xml" -targetdir:RingCentral.Tests/CoverageReport -reporttypes:Html

Open RingCentral.Tests/CoverageReport/index.html in a browser.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on RingCentral.Net:

Package Downloads
LagoVista.UserAdmin

User, Organization and Location Management Models and API for LagoVista IoT, Devices and Home Automation Framework

RingCentral.Net.AuthorizeUri

Authorize URI extension for RingCentral.Net

RingCentral.Net.Retry

Retry extension for RingCentral.Net

RingCentral.Net.PubnubPCL

PubNub extension for RingCentral.NET

RingCentral.Net.WebSocket

WebSocket extension for RingCentral.NET,

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.2.6 342 11/12/2024
6.2.5 175 11/6/2024
6.2.4 1,304 10/10/2024
6.2.3 319 10/9/2024
6.2.2 1,138 9/18/2024
6.2.1 1,397 8/28/2024
6.2.0 5,121 7/1/2024
6.1.6 2,788 6/17/2024
6.1.5 7,346 4/22/2024
6.1.4 991 4/2/2024
6.1.3 7,482 3/5/2024
6.1.2 1,961 2/12/2024
6.1.1 14,382 1/3/2024
6.1.0 6,213 12/10/2023
6.0.2 22,654 9/6/2023
6.0.1 2,241 8/21/2023
6.0.0 33,525 5/16/2023
6.0.0-beta4 938 4/11/2023
6.0.0-beta3 733 3/28/2023
6.0.0-beta2 896 1/5/2023
5.18.0 220,674 9/29/2022
5.17.0 31,248 6/1/2022
5.16.0 23,579 3/17/2022
5.15.0 6,738 3/16/2022
5.14.0 1,356 3/2/2022
5.13.0 33,045 2/23/2022
5.12.0 1,849 2/10/2022
5.11.0 18,414 1/27/2022
5.10.0 255,143 1/7/2022
5.9.0 36,541 11/17/2021
5.8.0 1,845 11/4/2021
5.7.0 41,005 9/30/2021
5.6.1 1,543 9/19/2021
5.6.0 1,532 9/8/2021
5.5.0 2,349 8/9/2021
5.4.0 2,472 7/30/2021
5.3.0 4,446 6/10/2021
5.2.0 11,436 4/29/2021
5.1.0 4,935 3/17/2021
5.0.0 3,054 3/3/2021
5.0.0-beta4 1,028 1/21/2021
5.0.0-beta3 957 1/11/2021
5.0.0-beta2 1,008 11/13/2020
5.0.0-beta1 1,923 10/27/2020
4.1.0 178,160 8/14/2020
4.0.1 2,224 7/31/2020
4.0.0 1,441 7/9/2020
4.0.0-beta4 12,984 4/27/2020
4.0.0-beta3 964 4/26/2020
4.0.0-beta2 976 4/25/2020
4.0.0-beta1 990 4/19/2020
3.2.0 44,754 3/23/2020
3.1.0-beta 1,031 2/25/2020
3.0.0 17,507 2/18/2020
2.4.0 2,063 1/27/2020
2.3.1 1,218 1/27/2020
2.3.0 2,971 12/31/2019
2.2.0 1,303 12/27/2019
2.1.0 69,700 10/10/2019
2.0.2 2,242 9/12/2019
2.0.1 2,728 9/3/2019
2.0.0 1,227 9/3/2019
2.0.0-beta2 2,625 7/17/2019
2.0.0-beta1 1,133 7/16/2019
1.2.1 8,837 6/18/2019
1.2.0 1,400 5/12/2019
1.1.1 1,488 4/3/2019
1.1.0 1,554 3/31/2019
1.0.1 1,308 3/30/2019
1.0.0 1,356 3/25/2019
0.6.3 1,327 3/13/2019
0.6.2 1,311 3/7/2019
0.6.1 1,295 2/23/2019
0.6.0 1,738 2/21/2019
0.4.0 1,601 1/16/2019
0.3.0 1,625 1/15/2019
0.2.0 1,597 1/15/2019
0.1.0 1,714 1/14/2019