RingCentral.Net 6.2.4

dotnet add package RingCentral.Net --version 6.2.4                
NuGet\Install-Package RingCentral.Net -Version 6.2.4                
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.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RingCentral.Net --version 6.2.4                
#r "nuget: RingCentral.Net, 6.2.4"                
#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.4

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

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.4 718 10/10/2024
6.2.3 300 10/9/2024
6.2.2 958 9/18/2024
6.2.1 1,253 8/28/2024
6.2.0 4,639 7/1/2024
6.1.6 2,589 6/17/2024
6.1.5 6,865 4/22/2024
6.1.4 953 4/2/2024
6.1.3 4,862 3/5/2024
6.1.2 1,919 2/12/2024
6.1.1 13,847 1/3/2024
6.1.0 6,118 12/10/2023
6.0.2 22,193 9/6/2023
6.0.1 1,753 8/21/2023
6.0.0 32,814 5/16/2023
6.0.0-beta4 932 4/11/2023
6.0.0-beta3 731 3/28/2023
6.0.0-beta2 892 1/5/2023
5.18.0 215,285 9/29/2022
5.17.0 31,088 6/1/2022
5.16.0 22,989 3/17/2022
5.15.0 6,736 3/16/2022
5.14.0 1,350 3/2/2022
5.13.0 32,373 2/23/2022
5.12.0 1,846 2/10/2022
5.11.0 18,406 1/27/2022
5.10.0 249,974 1/7/2022
5.9.0 36,514 11/17/2021
5.8.0 1,844 11/4/2021
5.7.0 40,982 9/30/2021
5.6.1 1,541 9/19/2021
5.6.0 1,529 9/8/2021
5.5.0 2,341 8/9/2021
5.4.0 2,469 7/30/2021
5.3.0 4,349 6/10/2021
5.2.0 11,409 4/29/2021
5.1.0 4,922 3/17/2021
5.0.0 2,969 3/3/2021
5.0.0-beta4 1,025 1/21/2021
5.0.0-beta3 954 1/11/2021
5.0.0-beta2 1,007 11/13/2020
5.0.0-beta1 1,922 10/27/2020
4.1.0 173,841 8/14/2020
4.0.1 2,109 7/31/2020
4.0.0 1,440 7/9/2020
4.0.0-beta4 12,766 4/27/2020
4.0.0-beta3 962 4/26/2020
4.0.0-beta2 975 4/25/2020
4.0.0-beta1 989 4/19/2020
3.2.0 43,559 3/23/2020
3.1.0-beta 1,028 2/25/2020
3.0.0 17,503 2/18/2020
2.4.0 2,060 1/27/2020
2.3.1 1,215 1/27/2020
2.3.0 2,948 12/31/2019
2.2.0 1,302 12/27/2019
2.1.0 69,470 10/10/2019
2.0.2 2,241 9/12/2019
2.0.1 2,727 9/3/2019
2.0.0 1,226 9/3/2019
2.0.0-beta2 2,592 7/17/2019
2.0.0-beta1 1,131 7/16/2019
1.2.1 8,836 6/18/2019
1.2.0 1,398 5/12/2019
1.1.1 1,485 4/3/2019
1.1.0 1,553 3/31/2019
1.0.1 1,306 3/30/2019
1.0.0 1,354 3/25/2019
0.6.3 1,326 3/13/2019
0.6.2 1,310 3/7/2019
0.6.1 1,294 2/23/2019
0.6.0 1,736 2/21/2019
0.4.0 1,598 1/16/2019
0.3.0 1,624 1/15/2019
0.2.0 1,596 1/15/2019
0.1.0 1,706 1/14/2019