question

Sy Hasan avatar image
Sy Hasan asked Phong Vu answered

Search User By email Or userName

Hi there, as I continue to learn more about the RingCentral API, I was curious to know how I would go about filtering and finding a user by a specific email or userName? Here is how I am currently searching:

method: GET,

content_type: application/json,

url: https://platform.ringcentral.com/scim/v2/Users?filter=&userName=testuser@email.com


I don't receive the results I would want from this sadly, as it gives me the default response of getting 100 items. I used this reference: https://developers.ringcentral.com/api-reference/SCIM/searchViaGet2

The startIndex and count work fine, but it is the filter parameter I am having trouble with.

Thank you!

rest api
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

You have to use SCIM filter syntax. Currently, we support only "eq" operator. Here is an example in Node JS

async function list_users_v2() {
  try{
    var params = {
      filter: "userName eq \"ryan.lee@live.com\"",
    }
    var resp = await platform.post("/scim/v2/Users/.search", params)
    var jsonObj = await resp.json()
    for (var item of jsonObj.Resources){
        console.log(JSON.stringify(item))
        console.log("==========")
    }
  }catch(e){
    console.log(e)
  }
}
1 |3000

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

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