Reputation: 11
Hi guys i have Teamviewer installed and would like to be able to ping Teamviewer ID's and get a response of the status of that PC.
try
{
string accessToken = "xxxxxxxxxxxxxxxxxxxx";
string Version = "v1";
string tvApiUrl = "https://webapi.teamviewer.com";
string address = tvApiUrl + "/api/" + Version + "/various commands from API";
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.Headers.Set("Authorization", "Bearer " + accessToken);
request.Method = "GET";
WebResponse response = request.GetResponse();
return response;
}
catch (Exception ex)
{
MessageBox.Show("Failed to get request with error: " + ex.Message);
return null;
}
this wont work because I haven't found anything related to the remote list of computers i have in Teamviewer. I want a way to check if the PC's in my Teamviewer list have internet programmatically. Thanks in advance
Upvotes: 0
Views: 3922
Reputation: 4965
This can be achieved using the TeamViewer API.
Have a look at the documentation under "3.10 Devices":
GET /api/v1/devices (list all devices from the computers & contacts list)
Parameters
Return values
Authentication
Request
GET /api/v1/devices
Response
HTTP/1.1 200 OK
Content-Type: application/json
{ "devices": [
{
"remotecontrol_id": "r123456789",
"device_id": "d123456789",
"alias": "PC",
"groupid": "g12345678",
"online_state": "Online"
},
{
"remotecontrol_id": "r123456780",
"device_id": "d345667567",
"alias": "Laptop",
"groupid": "g12345678",
"online_state": "Offline"
},
{
"remotecontrol_id": "r345678890",
"device_id": "d444443226",
"alias": "Office",
"groupid": "g12345678",
"online_state": "Offline"
}
]
}
Upvotes: 1