question

Jackson Khan avatar image
Jackson Khan asked Jackson Khan commented

What do I put in "filters" when using the GET or POST search users command?

I am trying to use the get command here: https://developers.ringcentral.com/api-reference/SCIM/scimSearchViaGet2


And it allows a filter "Only support 'userName' or 'email' filter expressions for now" but I'm not sure how to format it because I keep getting a 400 error:


{

"schemas": [

"urn:ietf:params:scim:api:messages:2.0:Error"

],

"status": "400",

"scimType": "invalidFilter",

"detail": "Only 'userName' or 'emails' fields and operation 'eq' are supported"

}

How do I enter the filter for an email address? I've tried email:person@company.com or userName:person@wellthy.com and still having issues.

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 Jackson Khan commented

Check out the search syntax from here. We don't support all operators though.

Here is an example to search by email address:

async function search_user() {
    var params = {
          //filter: 'userName co "john.smith@live.com"'
          //filter: 'phoneNumbers [type eq "work" and value eq "12341234567"
          filter: 'emails [type eq "work" and value eq "firstname.lastname@gmail.com"]'
    }
    try {
      var resp = await platform.get('https://platform.ringcentral.com/scim/v2/Users', param
      var jsonObj = await resp.json()
      for (var res of jsonObj.Resources)
        console.log(res)
    }catch(e){
        console.log(e)
    }
}
1 comment
1 |3000

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

Jackson Khan avatar image Jackson Khan commented ·

Great, that worked. Just fyi, the expression in the reference says "email" but that didn't work, I had to put emails:


/users/?filter=emails eq "test@company.com"
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