Skip to content

parts-zap-com/RingCentral.Net

 
 

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.

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 icons to NuGet packages

Packages

No packages published

Languages

  • C# 97.6%
  • JavaScript 1.7%
  • TypeScript 0.7%