Skip to main content
The First Step
May 13, 2022 4:52 PM UTC
Question

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!

    1 reply

    PhongVu
    Community Manager
    Community Manager
    May 13, 2022 7:01 PM UTC

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