
zl65l (zl65l) asked a question.
We use the UserAPI. When we call
userApiClient.listUsers(CONTENT_TYPE, null, after, limit, null, search, sortBy, sortOrder),
with the following parameters:
search: profile.accountId eq "xxx" and type.id eq "yyy"
after: 00u1aadtre06z5eVR358
limit: 30
sortBy: profile.employeeNumber
sortOrder: desc
we get this:
com.okta.sdk.resource.client.ApiException: {"errorCode":"E0000031","errorSummary":"Invalid search criteria.","errorLink":"E0000031","errorId":"oae-1ADf2njTOSCk7A-_H2A8w","errorCauses":[{"errorSummary":"Invalid cursor."}]}
Now, the "after" string is taken from the first call to the same function. So the first time it works, the second fails.
Investigation shows that it only happens when sortBy is set.
How can I get this to work?
/Klaus

@zl65l (zl65l) - That error is what I would expect to see with an invalidly structured request.
Doing some digging I see the following article:
https://developer.okta.com/docs/reference/user-query/#limits-and-pagination
This looks like an older article but it does have an example:
curl -v -X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/users?after=00u3p62n11UKppeh31d7&limit=5&search=status+eq+%22ACTIVE%22"
Which indicates you syntax should be fine. In my own testing it also fails even limiting it down to something as simple as the example above. So it looks like there may be a defect here. I'd suggest opening a case with the API's team.