RingCentral.Net 6.2.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package RingCentral.Net --version 6.2.3                
NuGet\Install-Package RingCentral.Net -Version 6.2.3                
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.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RingCentral.Net --version 6.2.3                
#r "nuget: RingCentral.Net, 6.2.3"                
#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.3

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

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 401 11/12/2024
6.2.5 190 11/6/2024
6.2.4 1,414 10/10/2024
6.2.3 321 10/9/2024
6.2.2 1,156 9/18/2024
6.2.1 1,425 8/28/2024
6.2.0 5,140 7/1/2024
6.1.6 2,802 6/17/2024
6.1.5 7,392 4/22/2024
6.1.4 993 4/2/2024
6.1.3 7,518 3/5/2024
6.1.2 1,963 2/12/2024
6.1.1 14,405 1/3/2024
6.1.0 6,222 12/10/2023
6.0.2 22,725 9/6/2023
6.0.1 2,271 8/21/2023
6.0.0 33,570 5/16/2023
6.0.0-beta4 940 4/11/2023
6.0.0-beta3 735 3/28/2023
6.0.0-beta2 898 1/5/2023
5.18.0 221,019 9/29/2022
5.17.0 31,263 6/1/2022
5.16.0 23,641 3/17/2022
5.15.0 6,740 3/16/2022
5.14.0 1,358 3/2/2022
5.13.0 33,085 2/23/2022
5.12.0 1,851 2/10/2022
5.11.0 18,416 1/27/2022
5.10.0 255,792 1/7/2022
5.9.0 36,547 11/17/2021
5.8.0 1,853 11/4/2021
5.7.0 41,013 9/30/2021
5.6.1 1,545 9/19/2021
5.6.0 1,534 9/8/2021
5.5.0 2,351 8/9/2021
5.4.0 2,474 7/30/2021
5.3.0 4,448 6/10/2021
5.2.0 11,438 4/29/2021
5.1.0 4,937 3/17/2021
5.0.0 3,067 3/3/2021
5.0.0-beta4 1,030 1/21/2021
5.0.0-beta3 959 1/11/2021
5.0.0-beta2 1,010 11/13/2020
5.0.0-beta1 1,925 10/27/2020
4.1.0 178,472 8/14/2020
4.0.1 2,237 7/31/2020
4.0.0 1,443 7/9/2020
4.0.0-beta4 13,018 4/27/2020
4.0.0-beta3 966 4/26/2020
4.0.0-beta2 978 4/25/2020
4.0.0-beta1 992 4/19/2020
3.2.0 44,931 3/23/2020
3.1.0-beta 1,033 2/25/2020
3.0.0 17,511 2/18/2020
2.4.0 2,065 1/27/2020
2.3.1 1,220 1/27/2020
2.3.0 2,975 12/31/2019
2.2.0 1,305 12/27/2019
2.1.0 69,732 10/10/2019
2.0.2 2,244 9/12/2019
2.0.1 2,732 9/3/2019
2.0.0 1,229 9/3/2019
2.0.0-beta2 2,627 7/17/2019
2.0.0-beta1 1,135 7/16/2019
1.2.1 8,839 6/18/2019
1.2.0 1,402 5/12/2019
1.1.1 1,490 4/3/2019
1.1.0 1,556 3/31/2019
1.0.1 1,310 3/30/2019
1.0.0 1,358 3/25/2019
0.6.3 1,329 3/13/2019
0.6.2 1,313 3/7/2019
0.6.1 1,297 2/23/2019
0.6.0 1,740 2/21/2019
0.4.0 1,603 1/16/2019
0.3.0 1,627 1/15/2019
0.2.0 1,599 1/15/2019
0.1.0 1,718 1/14/2019