我想通过 C# 程序在 Team Viewer 中接收打开的会话列表。我阅读了Team Viewer API 文档。
根据文档,OAuth 2.0 身份验证用于获取访问令牌。但我无法理解,如何将凭证信息传递给它。只是为了测试,我还尝试使用Postman Rest API创建访问令牌,但我也无法做到这一点。
string Version = "v1";
string tvApiUrl = "https://webapi.teamviewer.com/";
string address = tvApiUrl + "/api/" + Version + "/sessions";
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
//SOMEHOW I HAVE TO ASSIGN CREDENTIAL/AUTHENTICATION TO REQUEST HERE
request.Method = "GET";
WebResponse response = request.GetResponse();
Console.WriteLine(response);