Skip to main content
Solved

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


Forum|alt.badge.img

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.

Best answer by PhongVu

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)
    }
}
View original
Did this thread help you find an answer to your question?

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • November 8, 2023

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

Forum|alt.badge.img
  • Known Participant
  • November 9, 2023

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"

Forum|alt.badge.img
  • Known Participant
  • November 4, 2024

Hi there, for some reason this filtering stopped working, I keep getting a 404 error. 

 

  "body": "{\n  \"type\" : \"about:blank\",\n  \"title\" : \"Not Found\",\n  \"status\" : 404,\n  \"detail\" : \"No static resource scim/v2/Users.\",\n  \"instance\" : \"/scim/v2/Users/\"\n}",
  "message": "404 Not Found",
  "code": 404,
  "description": "HTTP Request Error",
  "steps": 50,
  "source": {
    "flo": "httpfunctions:1.0.24:get",
    "method": "s9WXrTRMrik",
    "execution": "ccfe7aaf-096c-4f08-8899-92009142a887",
    "module": "http.call"

 

If I just do a general search using https://platform.ringcentral.com/scim/v2/Users/ I am able to get a list of all our users (only up to 100 however.) 

 

Wondering what could have caused this? All other apis I have been using still work. 


Forum|alt.badge.img
  • Known Participant
  • November 4, 2024

It works while I’m testing it on the ringcentral API, but it for some reason doesn’t work in my Okta workflows… nothing changed...


Forum|alt.badge.img
  • Known Participant
  • November 4, 2024

I think I just did a workaround using this api so I might just do that: 

 

https://developers.ringcentral.com/api-reference/SCIM/scimSearchViaPost2


PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • November 5, 2024
jackson-1 wrote:

It works while I’m testing it on the ringcentral API, but it for some reason doesn’t work in my Okta workflows… nothing changed...

I am not aware of any change to the API. I run my test and it is working well.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings