question

Chad Corey avatar image
Chad Corey asked Phong Vu commented

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.

api
1 |1500 characters needed characters left characters exceeded

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

Phong Vu avatar image
Phong Vu answered

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"
    }
1 |1500 characters needed characters left characters exceeded

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

Chad Corey avatar image
Chad Corey answered

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

1 |1500 characters needed characters left characters exceeded

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

Phong Vu avatar image
Phong Vu answered

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.

1 |1500 characters needed characters left characters exceeded

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

Chad Corey avatar image
Chad Corey answered Phong Vu commented

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

1 comment
1 |1500 characters needed characters left characters exceeded

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

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

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