Hi,
I’ve a general question on the filtering of users.
I’ve an api call where I get all users in my Okta instance with (calling from postman):
https://xxxxxxxxxxx.okta.com/api/v1/users?filter=lastUpdated%20gt%20%222021-09-30T00:00:00.000Z%22 but I want to filter out Deprovisioned users and return all the rest so I tried:
https://xxxxxxxxxxx.okta.com/api/v1/users?filter=lastUpdated%20gt%20%222021-09-30T00:00:00.000Z%22%20and%20status%20ne%20%22DEPROVISIONED%22
Without the urlencoding:
https://xxxxxxxxxxx.okta.com/api/v1/users?filter=lastUpdated gt "2021-09-30T00:00:00.000Z" and status ne "DEPROVISIONED"
But this fails with a 400 bad request.
I know you can do a status eq "ACTIVE" or status eq "STAGED".
My question is why does ne (not equals) give a bad request but eq (equals) works?
Seems like I’ll need a string of status eq XXX or ... for all status except the one I want to filter out.
Is this correct?
This doesn’t seem very maintainable if there is a new status introduced, I’ll need to manually update my api calls that filter on status.
Filter status api doc section: Users | Okta Developer
Filter condition api doc section: Core Okta API | Okta Developer