News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
What do I put in "filters" when using the GET or POST search users command?
Tags: rest api
Nov 8, 2023 at 2:22pm   •   1 replies  •  0 likes
Jackson Khan

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.

1 Answer
answered on Nov 8, 2023 at 3:41pm  

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

 0
on Nov 9, 2023 at 10:47am   •  0 likes

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"



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us