首页 文章

使用RingCentral API的Web应用程序

提问于
浏览
0

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

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

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

最后,我希望能够登录和检索入站和出站呼叫日志,并在gridview中显示它们 .

我正在使用VS 2017,它是一个Web Forms应用程序 . 我没有选择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);

    }
}

Web应用程序的示例Web应用程序或存根代码将非常有用 . 谢谢,KSS

1 回答

相关问题