Packages are available on NuGet. You can install them just like you install any other NuGet packages.
Since version 5.0.0, this project has been changed to an extension based architecture.
- RingCentral.Net provides core features.
You need to install extensions if you need extra features:
- RingCentral.Net.AuthorizeUri provides utility methods to build URI for OAuth authorization purpose.
- RingCentral.Net.AutoRefresh auto refreshes your token.
- RingCentral.Net.Debug prints all HTTP traffic to console.
- RingCentral.Net.Events provides your with events about HTTP requests.
- RingCentral.Net.Pubnub if you need PubNub support and your app targets traditional .NET Framework.
- RingCentral.Net.PubnubPCL if you need PubNub support and your app targets .NET Core, Mono, Xamarin...etc.
- RingCentral.Net.RateLimit automatically handles rate limit for you.
- RingCentral.Net.Retry allows you to retry a REST request if there is
RestException
.
You can find sample code for all the endpoints.
There is also lots of useful code for your reference in our test cases.
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:
- If you run your app in .NET Core environment, you will not have this issue.
- If you only create one subscription in your code, you will not have this issue either.
- This is because by default only 2 connections to a server is allowed.
- More information FYI: https://stackoverflow.com/a/49868185/862862
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();
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.
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);
Update version number in RingCentral.Net/RestClient.cs
.
Update version number in <ProjectName>/<ProjectName>.csproj
cd <ProjectName>
dotnet pack
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)
- Add batch get to auto generated sample code
- Exception error message for binary data? Will it print a LOT?
- Add WebSocket extension