Skip to main content

I follow guide:

https://developers.ringcentral.com/guide/authentication/quick-start#c#


I got following compile error:

C:ProjectsDemoauthorization-demomy-projectStartup.cs(46,29,46,41): error CS1061: 'RestClient' does not contain a definition for 'AuthorizeUri' and no accessible extension method 'AuthorizeUri' accepting a first argument of type 'RestClient' could be found (are you missing a using directive or an assembly reference?)

1617899079361.png


Is the code out date, what is new code?


It is out date. C#.net SDK released 5.x which was a major upgrade: https://medium.com/ringcentral-developers/ringcentral-net-sdk-5-0-and-its-extensions-2992a5dc5caa


You need to use this extension to build oauthUri:

https://github.com/ringcentral/RingCentral.Net/tree/master/RingCentral.Net.AuthorizeUri


Replace

var oauthUri = rc.AuthorizeUri(RINGCENTRAL_REDIRECT_URL);

with

var authorizeUriExtension = new AuthorizeUriExtension(...);
await rc.InstallExtension(authorizeUriExtension);
var oauthUri = authorizeUriExtension.BuildUri(new AuthorizeRequest{   
redirect_uri = RINGCENTRAL_REDIRECT_URL
});


We will upgrade docs as soon as possible.


Please let me know when to doc has been upgraded


Reply