How do I call C# RingCentral Client Authoirze() method?

  • 1
  • Question
  • Updated 4 weeks ago
Need info on Calling RingCentral C# Authorize Method? There seems to be little or no documentation on this thing I'm trying this:
public async void MyLogin()
        {
            await myClient.Authorize("+1XXXXXXXXX", "", "password");
        }
This is no good of course it needs to return something but what? Please guys need more documentation!!!!

Thanks
       

Photo of Rick Smith

Rick Smith

  • 330 Points 250 badge 2x thumb

Posted 4 weeks ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,152 Points 5k badge 2x thumb
It does return something which you can inspect that method's return type if you use Visual Studio.

And the returned thing is not important if you just want to invoke some API call. As long as the authorize doesn't throw exception, you are authorized and you can go ahead to make API calls.

If there are exception, you can catch it and print the response: https://github.com/ringcentral/ringcentral-csharp-client#exception-handling
Photo of Rick Smith

Rick Smith

  • 330 Points 250 badge 2x thumb
Ok I got it figured out sort of; now it wants netstandard added. Did this within csproj but no go, it still doesnt like Authorize.

Sheesh...Lots of problems!!!
Photo of Tyler Long

Tyler Long, Official Rep

  • 7,822 Points 5k badge 2x thumb
Hi Rick,

months ago I created a short video for authorization and fax sending using C# SDK: https://www.youtube.com/watch?v=lECKMrX_Dgw&t=13s

I hope it helps.
Photo of Rick Smith

Rick Smith

  • 330 Points 250 badge 2x thumb
Tyler;

Thanks for the info, I got over that hurdle it appears to want Net framework 4.6.2 instead of 4.6.1 change that and it now accepts Authorize.

Unfortunately I kill one bug and another 1 shows up for the funeral :{

var response = await extension.Sms().Post(requestBody);

This throws extension does not exist in the current context. Has this been deprecated?
Im using the code from here https://github.com/ringcentral/ringcentral-csharp-client

Thanks Again!


Photo of Rick Smith

Rick Smith

  • 330 Points 250 badge 2x thumb
Just as an experiment I tried
    //var response = await extension.Sms().Post(requestBody);
            //var response = await ExtentionPath.Sms().post(requestBody);
            //var response = await SmsPath()
            //var response = await rc.PostContent(Endpoint(false), requestBody);
            //var response = await rc.PutContent(endpoint(false), requestBody);
            //var response = await rc.Post(endpoint(false), requestBody);
            //var response = await rc.Post(endpoint(true), requestBody);
            //var response = rc.Post(endpoint(false), requestBody);
none of them work Endpoint or endpoint does not exist in the current context...I think it belongs to PathSegement? but how do I set it up?

Need documentation!!!!

Photo of Tyler Long

Tyler Long, Official Rep

  • 7,822 Points 5k badge 2x thumb
Rick, I totally agree with you that we need more documentation.

For now, if you want to find code which works, please refer to the test cases: https://github.com/ringcentral/ringcentral-csharp-client/tree/master/RingCentral.Test

For sms sending: https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/SubscripotionT...