question

Lisa Xu avatar image
Lisa Xu asked Lisa Xu commented

RestClient does not contain AuthorizeUri

I follow guide:

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


I got following compile error:

C:\Projects\Demo\authorization-demo\my-project\Startup.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?


sdkauthentication
1617899079361.png (22.5 KiB)
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Tyler Liu avatar image
Tyler Liu answered Lisa Xu commented

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.

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Lisa Xu avatar image Lisa Xu commented ·

Please let me know when to doc has been upgraded

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys