0

我正在尝试让我的 C# Web 应用程序使用他们的 API 登录到 RingCentral。我是使用 Web API 的新手,不知道如何使用 RC。我查看了他们的文档,但没有成功。https://github.com/ringcentral/ringcentral-csharp-client

我知道我的 credz 工作,因为我可以登录他们的门户,而且我所有的密钥都没有改变。

添加“await”关键字时收到的第一个错误是它想将我的方法从 Page_Load 更改为“async”方法。其次是页面继承应该是 System.web.ui.page 还是 Ringcentral.page?

最后,我希望能够登录和检索入站和出站呼叫日志并将它们显示在网格视图中。

我正在使用 VS 2017,它是一个 Web 表单应用程序。我没有选择 MVC 或 Web API。我什至不能在断点上打破。

  public partial class _Default : Page
{
    //https://github.com/ringcentral/ringcentral-csharp-client

    private static String appKey = ConfigurationManager.AppSettings["appKey"].ToString();
    private static String appSecret = ConfigurationManager.AppSettings["appSecretKey"].ToString();
    private static bool isProduction = Convert.ToBoolean(ConfigurationManager.AppSettings["IsProduction"].ToString());

    private static String userName = ConfigurationManager.AppSettings["username"].ToString();
    private static String extension = ConfigurationManager.AppSettings["extension"].ToString();
    private static String password = ConfigurationManager.AppSettings["password"].ToString();
    private RestClient rc = null;

    protected async void Page_LoadAsync(object sender, EventArgs e)
    {

        rc = new RestClient(appKey, appSecret, isProduction);
        await rc.Authorize(userName, extension, password);

    }
}

一个示例网络应用程序或一个网络应用程序的存根代码将非常有帮助。谢谢, KSS

4

1 回答 1

0

一个示例网络应用程序或一个网络应用程序的存根代码将非常有帮助。

有关使用RingCentral C# 客户端 SDK的示例 Web 应用程序,请参阅以下使用 Nancy Web 框架 ( http://nancyfx.org/ ) 的 OAuth 身份验证代码演示。

https://github.com/ringcentral/ringcentral-demos-oauth/tree/master/csharp-nancy

于 2017-12-04T20:19:54.863 回答