Question

RestClient does not contain AuthorizeUri

  • 8 April 2021
  • 2 replies
  • 524 views

  • Participating Frequently
  • 5 replies

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?



2 replies

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