0 votes

Hi,

{
            "criteria": {
                "objectTypes": [
                    {
                        "type": "USER",
                        "items": {
                            "type": 1,
                            "items": [
                                {
                                    "type": 0,
                                    "property": "accountDisabled",
                                    "operator": "eq",
                                    "values": [
                                        {
                                            "type": 6,
                                            "value": false
                                        }
                                    ]

                                }

                            ],
                            "logicalOperator": "1"
                        }
                    }
                ]
            },
            "select": {
                "properties": "employeeID,department,objectGUID,title,userPrincipalName,manager,employeeType,termDate,description,whenCreated"
            }
        }

I'm using the REST API to pull all the disabled users. BUt the query doesn't return any response. Looking for those records whose

"accountStatus": { "isDisabled": true,

Please share the right request JSON to get the required result.

Thanks, Lohith

by (20 points)
edited by

1 Answer

0 votes
by (14.5k points)

Hello,

The thing is accountDisabled is a virtual search property, it can be used in the expression when you build a criteria. However, in a Json-formatted REST API request, you need to use the adm-SearchAttraccountDisabled property to search enabled/disabled accounts. The full request body in Json format should look like this:

{
    "criteria": {
        "ObjectTypes": [
            {
                "Type": "User",
                "Items": {
                    "Type": 1,
                    "Items": [
                        {
                            "Type": 0,
                            "Property": "adm-SearchAttraccountDisabled",
                            "Operator": "eq",
                            "Values": [
                                {
                                    "Type": 6,
                                    "Value": true
                                }
                            ],
                            "ValueLogicalOperator": 0
                        }
                    ],
                    "LogicalOperator": 1
                }
            }
        ]
    },
    "select": {
        "properties": "employeeID,department,objectGUID,title,userPrincipalName,manager,employeeType,termDate,description,whenCreated"
    }
}

Related questions

0 votes
2 answers

Right now, we are generating the request for create new users via Webpage, I would like to know if there is a possibility to generate this kind of request using the API or SDK

asked Apr 20, 2020 by jcvertiz_stk (20 points)
0 votes
1 answer

Hello, We encoutered an issue with Adaxes in default configuration. We are mainly using Adaxes for its REST API, to automate identity lifecycle with our HRIS. We tried to update ... got enforced even on an API REST attribute change? If so how to disable it?

asked Aug 18, 2022 by ygini (240 points)
0 votes
0 answers

Hello We are using the REST API with the Business Unit method to get all our users in once, and it works really well, the API return around 150 in a second when ... proper way with Adaxes REST API to read the current expiration time for all accounts? Thanks

asked Jun 25, 2022 by ygini (240 points)
0 votes
1 answer

Hello! We are currently trying to use the REST API to search for all group objects in our domain, but the search result is only returning 1000 objects. We tried supplying a ... the request. Is there a way to retrieve more than 1000 objects using the REST API?

asked Feb 16, 2022 by KelseaIT (320 points)
0 votes
1 answer

Is it possible to add multiple members to a group in a singe call to the REST API? The example code only shows a single member. What would the data structure look like in that case?

asked Dec 13, 2021 by swengr59 (60 points)
3,577 questions
3,266 answers
8,282 comments
548,008 users