How to check device's online state by API with C#?

I'm trying to check the teamviewer device's online state with teamviewer ID.

I already made token that allows all the authentication. This is my code.

static void Main(string[] args)
{
    string accessToken = "xxxxxxxxxxxxxxxxxxx";
    string apiVersion = "v1";
    string tvApiBaseUrl = "https://webapi.teamviewer.com";
    string address = tvApiBaseUrl + "/api/" + apiVersion + "/reports/connections";


    try
    {
        // Create the web request  
        HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
        request.Headers.Add("Authorization", "Bearer " + accessToken);
        request.Method = "GET";
        WebResponse webResp = request.GetResponse();
    }
    catch (Exception)
    {
        // Do nothing for now
    }
}

I don't know if the /reports/connections is appropriate for my situation.

Is there any sample code or the way how to get online state about specific teanviewer ID?

Tagged: