Are certain user properties not able to have a filter applied? Skip to main content
https://support.okta.com/help/answers?id=906f0000000hzwkiac&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Gregg PolitesGregg Polites 

Are certain user properties not able to have a filter applied?

I am using the API to pull a list of users that have not logged in with X amount of days.  When I send the GET request, I get back:

{
  "errorCode": "E0000031",
  "errorSummary": "Invalid search criteria.",
  "errorLink": "E0000031",
  "errorId": "oae4-ksXbvLQGeSM671uwRAMg",
  "errorCauses": []
}

The filter string I use is:

/users?limit=200&filter=lastLogin+lt+"2016-01-08T11:12:14.000Z"

It seems to be the correct format because if I switch it to filter on the "lastUpdated" property, I receive a list of users as expected.  EG:

/users?limit=200&filter=lastUpdated+lt+"2016-01-08T11:12:14.000Z"

Is the lastLogin property filterable?
api-workday api-workdayapi-workday api-workday
Hi Gregg, I've not seen a definitive list of attributes that are filterable but I know it is currently limited. I am also under the impression that plans exist to make this list of indexed/filterable attributes configurable by an Org administrator. I have used to the hunt and peck approach to find that these are the attributes are filterable.

lastUpdated,status,firstname,lastname,login,email

Hope that helps,
-Matt
Raphael LondnerRaphael Londner (Okta, Inc.)
As a matter of fact, the only user attributes that are currently filterable are strictly documented in the following section of our developer site: http://developer.okta.com/docs/api/resources/users.html#filters

The lastLogin attribute is unfortunately not filterable at this point.
api-workday api-workdayapi-workday api-workday
Thanks for the Clarification Raphael

Reading that section it comes across as more of an example of filter formats that CAN be used not as a definitive and strictly described list of attributes and operators combination that can be used.

-Matt

 
Gregg PolitesGregg Polites
Thanks Raphael, I saw that list before but I didn't take it to be exhaustive.

I do hope it can be added.  The only way for me to work around this is to pull a list of all users and filter on that.  This is something I'll need daily so it might be a bit of a resource drain.
Sam YatesSam Yates
So are the operators on that list also the only ones that are supported?  Specifically, is "eq" the only thing you can use for a string comparison?
api-workday api-workdayapi-workday api-workday
Hi Sam, yes.

if you need something that does a more ambigous name resolution you can use this

http://developer.okta.com/docs/api/resources/users.html#list-users-with-search
 
Searches for user by firstName, lastName, or email value. This operation is ideal for implementing a people picker. This operation does not support pagination

HTH,
-Matt