Skip to content

agreentejada/RingCentral.Net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RingCentral.Net

Build Status

Installation

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

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.

PubNub notification delay issue

If you create multiple subscriptions in a single app and run the app in .NET Framework environment, you may experience notifications delay. Delay time is around 4 minutes and 30 seconds.

A solution/workaround is to add the following to your app.config file:

<system.net>
<connectionManagement>
<add address = "*" maxconnection = "999" />
</connectionManagement>
</system.net>

Notes:

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);

For maintainers

Release

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

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

cd <ProjectName>
dotnet pack

RingCentral.Net.Pubnub

Update version number in RingCentral.Net.Pubnub\Properties\AssemblyInfo.cs Update version number in RingCentral.Net.Pubnub\RingCentral.Net.Pubnub.nuspec

Rebuild solution

cd RingCentral.Net.Pubnub
nuget pack

Reference: Quickstart: Create and publish a package using Visual Studio (.NET Framework, Windows)

Todo

  • Add batch get to auto generated sample code
  • Exception error message for binary data? Will it print a LOT?
  • Add WebSocket extension

About

RingCentral SDK for .NET

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 97.2%
  • JavaScript 2.8%