Skip to main content

I'm using C# with RingCentral's SDK, I'm trying to get a list of all DeviceID's and MAC's, the only way I can see is by making a bunch of calls after pulling an extension list?


My end goal is to locate the users physical desk phone's deviceID using the MAC or IP address.


Is there an easier way to do this than making a ridiculous amount of calls after pulling an extension list?



Thank you

There is a workaround solution in C#. I am not sure why the /device endpoint is not documented. But at least, I can read all devices under an account using this endpoint 'restapi/v1.0/account/~/device'.

Unfortunately, this endpoint is not supported in the .NET SDK (because it is not in the specs). But you can call the raw Get function as shown in the sample code below:

static private async Task read_account_devices()
{
try
{
string endpoint = "restapi/v1.0/account/~/device";
var response = await rcsdk.Get(endpoint);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}

You're awesome, thanks Phong. Using what you gave me I was able to do the following, if I'm being silly and these parameters already exist let me know please - figured it might help someone eventually though.

https://ghostbin.com/FvoZh


Reply