I want to get the list of the conencted devices and their connected status in .net core application. i am using GET /rest/system/connections to get status but its not returning the list of connected devices in application.
Here is the code
client.DefaultRequestHeaders.Add("X-API-Key", "");
var response = await client.GetAsync("https://localhost:8384/rest/system/connections");
with the await function it skipping without any error.
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
};
using var client = new HttpClient(handler);
client.DefaultRequestHeaders.Add("X-API-Key", "key");
var response = await client.GetAsync("https://localhost:8384/rest/system/connections");
response.EnsureSuccessStatusCode(); // Throw if not 2xx
string result = await response.Content.ReadAsStringAsync();
Is this redacted or is it the real code? The actual value of X-API-Key should be your API key which should look something like zHu6YvVJNg9p9RqLW5krtv27LCJzwi3i. key is not an API key you could get randomly.
Note: this is not a request for knowing your API key