Skip to main content
The First Step
Sep 28, 2020 6:59 PM UTC
Question

Multiple API Questions

I have some questions about some API functionality.


1. Is it possible to find a user/extension by searching by a custom field? We are using a custom field to store our company unique assigned ID so t hat we can, hopefully, tie a user/ext in RC to our internal employee ID.

2. Is it possible to add sites/companies into the sandbox? Our company uses sites in production and I would like to test various things in an environment that can more closely mimic prod.

3. Do you have a demo of the API events/notifications system or a sample response that would be sent from that system?

4. The API site for creating an extension doesn’t show what fields are absolutely required. Do you have a list?


If it matters, I am using C# and the ringcentral NuGet package.

    5 replies

    PhongVu
    Community Manager
    Community Manager
    Sep 28, 2020 11:27 PM UTC

    1. Is it possible to find a user/extension by searching by a custom field? We are using a custom field to store our company unique assigned ID so t hat we can, hopefully, tie a user/ext in RC to our internal employee ID.

    As far as I know, there is no custom field search filter.


    2. Is it possible to add sites/companies into the sandbox? Our company uses sites in production and I would like to test various things in an environment that can more closely mimic prod.

    Yes, you can open a support ticket and request for this.


    3. Do you have a demo of the API events/notifications system or a sample response that would be sent from that system?

    What events/notifications?


    4. The API site for creating an extension doesn’t show what fields are absolutely required. Do you have a list?

    The minimum requirement is a contact object and the type

    var params =
          contact:
            firstName: "
            lastName: "
            email: "
            emailAsLoginName: true/fal
          
          type: "User"
        }
    The First Step
    Sep 29, 2020 1:32 PM UTC

    the notification I was most interested in was one that would show extension numbers and/or a phone number being changed.

    PhongVu
    Community Manager
    Community Manager
    Sep 29, 2020 4:48 PM UTC

    You can add this class to your code. Remember to install the latest RC PubNub SDK.

    static private async Task pubnub_notification()
    {
        try
        {
            var eventFilters = new[]
                    {
                        "/restapi/v1.0/account/~/extension/~"
                    };
    
            var subscription = new Subscription(rcsdk, eventFilters, message =>
                    {
                        Console.WriteLine("Incoming event");
                        var jsonObj = JObject.Parse(message);
                        Console.WriteLine(jsonObj["body"]);
                    });
            var subscriptionInfo = await subscription.Subscribe();
    
            Console.WriteLine(subscriptionInfo.id);
            Console.WriteLine("Subscribed");
            while (true)
            {
                Console.WriteLine("looping ...");
                Thread.Sleep(5000);
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }
    } 
    // sample event data
    
    {  
        "extensionId": "17800xxxx
        "eventType": "Update"
        "hints":[
            "AnsweringRules"
       ]
    }

    You will get just the event. There will be no info about the change though.

    The First Step
    Oct 7, 2020 8:45 PM UTC

    Once the ability to add sites in sandbox is active, how do you add one?

    PhongVu
    Community Manager
    Community Manager
    Oct 7, 2020 10:40 PM UTC

    You should get help from the dev support after enabling multiple sandbox accounts