okta-developer-docs icon indicating copy to clipboard operation
okta-developer-docs copied to clipboard

/devices is missing info on getting users, etc

Open gabrielsroka opened this issue 2 years ago • 26 comments

https://developer.okta.com/docs/reference/api/devices is missing info on getting users (and perhaps other related collections)

to get a device's users: GET /api/v1/devices/${deviceId}/users

this would be analogous to getting a group's users: GET /api/v1/groups/${groupId}/users which is documented here: https://developer.okta.com/docs/reference/api/groups/#list-group-members

gabrielsroka avatar Dec 06 '22 15:12 gabrielsroka

Thanks, Gabriel. Will review and get back to you on this one, too.

brianduffield-okta avatar Dec 08 '22 14:12 brianduffield-okta

also missing info on

/api/v1/devices?search=managementStatus eq "MAN"&expand=user
/api/v1/devices?search=managementStatus eq "UNMAN"&expand=user

etc

EDIT: added &expand=user to clarify

gabrielsroka avatar Dec 14 '22 16:12 gabrielsroka

Logged internal ticket to address: https://oktainc.atlassian.net/browse/OKTA-567622

brianduffield-okta avatar Jan 25 '23 20:01 brianduffield-okta

Any news on this?

gabrielsroka avatar Mar 03 '23 15:03 gabrielsroka

Assigned it to another writer. Let me check.

brianduffield-okta avatar Mar 03 '23 16:03 brianduffield-okta

Any news?

gabrielsroka avatar Apr 04 '23 15:04 gabrielsroka

Hi Gabriel,

Unfortunately, just in the backlog, I think. The monthly release is taking precedence at the moment; hopefully, after that.

Brian

brianduffield-okta avatar Apr 04 '23 17:04 brianduffield-okta

Hi @gabrielsroka ,

I've chatted with the Devices team (some of whom remember you from your Okta days).

They wonder if the following operation handles your use cases: https://developer.okta.com/docs/reference/api/devices/#usage-example-expand-user

If not, please let us know what's missing. We do realize that we should doc the following:

search=managementStatus eg MAN

I look forward to hearing from you,

Brent

brentschaus-okta avatar Apr 14 '23 21:04 brentschaus-okta

Your link expands users for all devices. My example is for one specific device. I think both of useful.

What's missing

I don't know. I'm reverse engineering the API by using the UI. It seems better to ask the engineers what's in the API so we can document it.

gabrielsroka avatar Apr 14 '23 21:04 gabrielsroka

Hi Gabriel,

The new operation is live on the "old" docs site: https://developer.okta.com/docs/reference/api/devices/#list-all-users-for-a-device

And will be live on the new redocly site in a few days (it'll appear at the bottom of the list of operations in the left nav): https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Device/

I know we still need to capture the details of the managementStatus parameter. I'll do that soon in another PR.

brentschaus-okta avatar May 04 '23 20:05 brentschaus-okta

it doesn't seem to paginate, nor accept the limit or after parameters

gabrielsroka avatar May 04 '23 20:05 gabrielsroka

it doesn't seem to paginate, nor accept the limit or after parameters

Okay... following up. Sorry for the delay.

brentschaus-okta avatar May 11 '23 14:05 brentschaus-okta

hi again,

this came up again today. ~you said on May 4 that it was on the old site, now the old site is gone, and it's not on the new site.~ EDIT: nm, i was confused.

i opened this issue in Dec. do u have an ETC?

gabrielsroka avatar Jun 28 '23 18:06 gabrielsroka

Hi @gabrielsroka , are we now able to close this issue? Thank you again for your patience.

brentschaus-okta avatar Jul 05 '23 13:07 brentschaus-okta

Waiting on this

https://github.com/okta/okta-developer-docs/issues/3789#issuecomment-1544091899

gabrielsroka avatar Jul 05 '23 15:07 gabrielsroka

Hi @gabrielsroka , can you please review this List Devices reference? We recently updated the expand query parameter with user info and added pagination content. Please let us know if this addresses your issues. Thanks!

vanngo-okta avatar Dec 07 '23 16:12 vanngo-okta

  1. the doc still doesn't mention managementStatus , see https://github.com/okta/okta-developer-docs/issues/3789#issuecomment-1351692951
  2. ?expand=userSummary doesn't work (but ?expand=user does)

image

gabrielsroka avatar Dec 07 '23 16:12 gabrielsroka

also need devices for a given user /api/v1/users/${userId}/devices

gabrielsroka avatar Dec 07 '23 18:12 gabrielsroka

Sorry @gabrielsroka , I got ahead of myself, the expand=userSummary option is currently being deployed on Preview. If you have a Production org, you won't see the feature until next week.

For your other questions:

  1. The following requests aren't supported:
/api/v1/devices?search=managementStatus eq "MAN"
/api/v1/devices?search=managementStatus eq "UNMAN"

managementStatus property is inside the _embedded.users array payload, so you can't do a search on that optional payload. You can do a search on a specific device ID, and set expand=user to pick up the managementStatus property in the expanded payload. (Also, managementStatus = MANAGED | NOT_MANAGED )

  1. The GET /api/v1/devices/{deviceId}/users endpoint doesn't support the search query parameter.

vanngo-okta avatar Dec 07 '23 20:12 vanngo-okta

i confirmed userSummary works in preview. thanks.

  1. aren't supported

what do you mean "not supported"? i tried it. it works. it's how the UI does it, too. did u try it?

  1. GET /api/v1/devices/{deviceId}/users

i'm not sure what you're referencing here.

gabrielsroka avatar Dec 07 '23 20:12 gabrielsroka

i confirmed userSummary works in preview. thanks.

Note that managementStatus isn't returned for userSummary yet (it should be added as a payload soon)

  1. aren't supported

what do you mean "not supported"? i tried it. it works. it's how the UI does it, too. did u try it?

When I try this request, I don't get anything meaningful. But going by the reference docs, managementStatus is not a first-level property from the Devices payload, so this request isn't officially supported. If you have questions about API behaviour, please contact Okta support. If you think it's a documentation issue, what do you think needs updating? I can create a doc request and follow up on the doc-gap.

  1. GET /api/v1/devices/{deviceId}/users

i'm not sure what you're referencing here.

I thought one of your questions was about using search on GET /api/v1/devices/{deviceId}/users. Apologies if this is not the case. I'm getting confused with the long trail.

also need devices for a given user /api/v1/users/${userId}/devices

I can't find documentation on this endpoint (it's probably not supported). Nevertheless, I'll open a doc query into this endpoint to confirm. Thanks for your patience while we migrate to the OpenAPI spec.

vanngo-okta avatar Dec 07 '23 20:12 vanngo-okta

this is what the UI does [1] [2]

Okta customers need this functionality via the API, too (not just the UI). since it's undocumented but easily discoverable, i'm asking for it to be documented since it's useful and necessary.

contact Okta support

I'm not a customer. i'm trying to help customers who are asking for this stuff.

/api/v1/users/${userId}/devices

again, the UI does this. customers need it. it's a public (but undocumented) api. i'm asking for it to be documented.

[1] managed MAN image


[2] unmanaged UNMAN image

gabrielsroka avatar Dec 07 '23 21:12 gabrielsroka

note what was said in the above 2 comments by @brentschaus-okta

We do realize that we should doc the following: search=managementStatus eg MAN

https://github.com/okta/okta-developer-docs/issues/3789#issuecomment-1509273052

we still need to capture the details of the managementStatus parameter. I'll do that soon

https://github.com/okta/okta-developer-docs/issues/3789#issuecomment-1535353912

gabrielsroka avatar Dec 07 '23 21:12 gabrielsroka

@gabrielsroka Thanks for calling this out and for your patience working through the issue here! I think our best approach from this point is to both work with CSMs and support to engage with internal teams and also log some Okta Ideas to reflect the behavior you need and get support from the larger community. This will provide better justification for this request. Thanks again!

jefftaylor-okta avatar Dec 11 '23 19:12 jefftaylor-okta

any update on this @brentschaus-okta , et al? it's been 18 months.

yet another Okta customer asked for this.

gabrielsroka avatar Jun 25 '24 16:06 gabrielsroka

Hi Gabriel, this was left in the Engineering and PM's court as last I recall. Let me re-engage with the team.

brianduffield-okta avatar Jun 25 '24 17:06 brianduffield-okta

Nevertheless, I'll open a doc query into this endpoint to confirm.

@vanngo-okta Any follow-up on this? I would like to use the /v1/users/{userID}/devices API rather than returning all devices via the /v1/devices (with userSummary embedded objects) and manually filtering by the user I need.

camscale avatar Oct 14 '24 07:10 camscale

Hi @camscale, thanks for the note. Still working with our engineering/PM team on this. I've pinged the current dev manager and hope to get a resolution for you shortly.

brianduffield-okta avatar Oct 15 '24 15:10 brianduffield-okta