Skip to main content
Solved

List of all DeviceID's and MAC's?

  • November 11, 2021
  • 2 replies
  • 1146 views

Forum|alt.badge.img

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

Best answer by PhongVu

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);
    }
}
View original
Did this thread help you find an answer to your question?

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2331 replies
  • Answer
  • November 11, 2021

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);
    }
}

Forum|alt.badge.img

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings