question

Nate Breeden avatar image
Nate Breeden asked Nate Breeden commented

List of all DeviceID's and MAC's?

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

rest apisdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered Nate Breeden commented

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);
    }
}
3 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Nate Breeden avatar image Nate Breeden commented ·

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

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Nate Breeden commented ·

No, the class object to hold the response does not exist. You did the right thing similar to what I showed you for the answering rules response. Good job!

1 Like 1 ·
Nate Breeden avatar image Nate Breeden Phong Vu ♦♦ commented ·

Yes sir, trying to learn from what you've provided for me lol

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys