See api-docs Menu

Get Apps for a User

Get a list of apps accessible by a user, not including personal apps.

To get a list of apps accessible by a user to embed in your company intranet, for example, see Get Apps to Embed for a User.

Resource URL

https://<subdomain>/api/1/users/:id/
apps

Header Parameters

Authorization

required

string

Set to bearer:<access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Read Users, Manage users, Read All, or Manage All.

Resource Parameters

id:

required

integer

Set to the id of the user for which you want to return a list of apps.

If you don’t know the user’s id, use the Get Users API call to return all users and their id values.

Sample Response

{
    "status": {
        "error": false,
        "code": 200,
        "type": "success",
        "message": "Success"
    },
    "data": [
        {
            "id": 436448,
            "name": "AWS DynamoDB Multi Role Production",
            "icon": "https://image.com/mobile_50.png?1421095823",
            "provisioned": "unknown",
            "extension": false,
            "login_id": 66666666,
            "personal": false
        },
        {
            "id": 482932,
            "name": "Workplace by Facebook",
            "icon": "https://image.com/mobile_50.png?1431478030",
            "provisioned": "unknown",
            "extension": false,
            "login_id": 99999999,
            "personal": false
        },
        {
            "id": 415452,
            "name": "NetFlix",
            "icon": "https://image.com/mobile_50.png?1427292256",
            "provisioned": null,
            "extension": true,
            "login_id": 88888888,
            "personal": false
        }
    ]
}

This is what a 200 OK response looks like with no app results:

{
    "status": {
        "error": false,
        "code": 200,
        "type": "success",
        "message": "Success"
    },
    "data": [
        []
    ]
}

Typically, this error means that your Authorization header value is missing or incorrectly formatted. The Authorization header value should use this format: bearer:<access_token>.

{
    "status": {
        "error": true,
        "code": 400,
        "type": "bad request",
        "message": "Authorization Information is incorrect"
    }
}

Typically, this error means that your access token value is invalid.

{
    "status": {
        "error": true,
        "code": 401,
        "type": "Unauthorized",
        "message": "Authentication Failure"
    }
}
{
    "status": {
        "error": true,
        "code": 403,
        "type": "forbidden",
        "message": "user is not authorized to access this User"
    }
}
{
    "status": {
        "error": true,
        "code": 404,
        "type": "not found",
        "message": "User for id 111111111 was not found"
    }
}

Response Fields

extension

Indicates whether the app requires the OneLogin browser extension to login.

Valid values are:

  • true: The app requires the OneLogin browser extension.

  • false: The app does not require the OneLogin browser extension.

icon

URL to the app’s icon.

id

ID of the app that can be accessed by the user.

login_id

User’s ID in the app. For example, in one app the user’s ID may be georgia.wong@company.com, but in another it may be georgia.wong.

name

Name of the application.

personal

Indicates whether the app is a user’s personal app.

Valid values are:

  • true: The app is a user’s personal app.

  • false: The app is not a user’s personal app.

provisioned

Indicates whether a username and password has been stored on the login for the app and user.

Valid values are:

  • 0 (no)
  • 1 (yes)

Postman Collection

Be sure to set Postman-specific environment variables indicated by {{ }}.

Run in Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

curl 'https://<subdomain>/api/1/users/<user_id>/apps' \
-X GET \
-H "Authorization: bearer: <access_token>"

Python

See Work with OAuth 2.0 Tokens, Users, and Roles.


Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.