/appLinks returns an empty array but user is assigned an application

I’m calling the /appLinks api (https://dev-XXXXXX.oktapreview.com/api/v1/users/{valid user id}/appLinks) and am getting an empty array back. I have assigned my test user to an application and can see that within both the user and in the application. Some experimentation has shown that I must have a valid user id and API token as if I change either of those I get an error.

Is there something else I should be looking at? I’m pretty new to the Okta world and easily could have missed something.

Hi @stdunbar

Are you able to access https://dev-XXXXXX.oktapreview.com/api/v1/users/me/appLinks in the browser in order to retrieve the logged in user’s applications?

Hi Dragos,
The headers required prevent me from using a browser but in Postman I just get “[]” - an empty JSON array.

Hi @stdunbar

Would it be possible to send an email to support@okta.com in order to have one of our Support engineers assist you with this use case?

is this issue resolved? I still see the issue, two different results for

/api/v1/users/{{userid}}/appLinks

/api/v1/apps?filter=user.id+eq+"{{userid}}"

/api/v1/users/{{userid}}/appLinks this one allows even email in the {{userid}} field for search which avoids one additional call to fetch userid.

I too was wondering why appLinks returns empty, using an API token when attempting to retrieve a user’s linked apps.

The answer might be here:
https://support.okta.com/help/s/article/Why-do-results-vary-when-referencing-the-applinks-API-endpoint-from-a-Browser-or-from-a-different-medium?language=en_US

The Apps returned via /appLinks are the App Cards seen on the user’s dashboard. If a user is assigned to an application that has the Login initiated by set to either Okta or App , and Application visibility is set to Display application icon to users - it will appear.
Please note that the API call /api/v1/users/{{UserID}}/appLinks , when performed through a token, will not have access to the Personal Apps set up and managed by the end user. Conversely, if the call is performed through the browser, by the user who has a session, it will have access to the Personal Apps set up by the end user, who are only visible for him.

The documentation at Users | Okta Developer does not mention this restriction.

(related, closed, topic: User API - appLinks returns 0 results)

To see if a user is an assigned to an app:

/api/v1/apps/{$applicationId}/users/{$userId}

That will return an Application User if the user is assigned to the app. This requires you knowing the applicationId and the userId must be a user.id (not the user.login)

hope this helps someone!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.