RingCentral.Net 6.2.1

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

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

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 (8)

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

Package Downloads
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,

RingCentral.Net.AutoRefresh

Auto Refresh extension for RingCentral.Net

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.2.2 297 9/18/2024
6.2.1 904 8/28/2024
6.2.0 3,603 7/1/2024
6.1.6 1,866 6/17/2024
6.1.5 5,947 4/22/2024
6.1.4 856 4/2/2024
6.1.3 3,109 3/5/2024
6.1.2 1,806 2/12/2024
6.1.1 12,705 1/3/2024
6.1.0 5,944 12/10/2023
6.0.2 20,726 9/6/2023
6.0.1 1,371 8/21/2023
6.0.0 31,311 5/16/2023
6.0.0-beta4 877 4/11/2023
6.0.0-beta3 717 3/28/2023
6.0.0-beta2 876 1/5/2023
5.18.0 203,612 9/29/2022
5.17.0 30,630 6/1/2022
5.16.0 21,760 3/17/2022
5.15.0 6,714 3/16/2022
5.14.0 1,334 3/2/2022
5.13.0 31,099 2/23/2022
5.12.0 1,832 2/10/2022
5.11.0 18,361 1/27/2022
5.10.0 237,712 1/7/2022
5.9.0 36,393 11/17/2021
5.8.0 1,814 11/4/2021
5.7.0 39,980 9/30/2021
5.6.1 1,521 9/19/2021
5.6.0 1,510 9/8/2021
5.5.0 2,319 8/9/2021
5.4.0 2,444 7/30/2021
5.3.0 4,182 6/10/2021
5.2.0 11,369 4/29/2021
5.1.0 4,873 3/17/2021
5.0.0 2,830 3/3/2021
5.0.0-beta4 1,004 1/21/2021
5.0.0-beta3 934 1/11/2021
5.0.0-beta2 989 11/13/2020
5.0.0-beta1 1,732 10/27/2020
4.1.0 165,061 8/14/2020
4.0.1 2,079 7/31/2020
4.0.0 1,419 7/9/2020
4.0.0-beta4 12,354 4/27/2020
4.0.0-beta3 946 4/26/2020
4.0.0-beta2 953 4/25/2020
4.0.0-beta1 968 4/19/2020
3.2.0 39,938 3/23/2020
3.1.0-beta 1,010 2/25/2020
3.0.0 17,478 2/18/2020
2.4.0 2,032 1/27/2020
2.3.1 1,200 1/27/2020
2.3.0 2,856 12/31/2019
2.2.0 1,282 12/27/2019
2.1.0 69,192 10/10/2019
2.0.2 2,183 9/12/2019
2.0.1 2,707 9/3/2019
2.0.0 1,205 9/3/2019
2.0.0-beta2 2,523 7/17/2019
2.0.0-beta1 1,094 7/16/2019
1.2.1 8,797 6/18/2019
1.2.0 1,378 5/12/2019
1.1.1 1,465 4/3/2019
1.1.0 1,512 3/31/2019
1.0.1 1,286 3/30/2019
1.0.0 1,335 3/25/2019
0.6.3 1,308 3/13/2019
0.6.2 1,290 3/7/2019
0.6.1 1,276 2/23/2019
0.6.0 1,705 2/21/2019
0.4.0 1,578 1/16/2019
0.3.0 1,594 1/15/2019
0.2.0 1,576 1/15/2019
0.1.0 1,675 1/14/2019