Skip to main content
Amplifying the VIBE
Nov 8, 2023 10:22 PM UTC
Solved

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.

    PhongVu
    PhongVuAnswer
    Community Manager
    Nov 8, 2023 11:41 PM UTC

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

    6 replies

    PhongVu
    Community Manager
    PhongVuAnswer
    Community Manager
    Nov 8, 2023 11:41 PM UTC

    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)
        }
    }
    jackson-1Amplifying the VIBEAuthor
    Amplifying the VIBE
    Nov 9, 2023 6:47 PM UTC

    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"
    jackson-1Amplifying the VIBEAuthor
    Amplifying the VIBE
    Nov 4, 2024 9:41 PM UTC

    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. 

    jackson-1Amplifying the VIBEAuthor
    Amplifying the VIBE
    Nov 4, 2024 10:07 PM UTC

    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...

    jackson-1Amplifying the VIBEAuthor
    Amplifying the VIBE
    Nov 4, 2024 10:46 PM UTC

    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
    Community Manager
    Nov 5, 2024 3:59 PM UTC

    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.