Get All Accounts for a User

get

/iam/governance/selfservice/api/v1/accounts

Returns a list of all accounts provisioned to user(s). For example: To get a list of accounts provisioned to a user the URI is /account?userid={userKey}. To get all the accounts which are provisioned to an application instance use the URL /accounts?appInstance={applicationInstanceName}.

Request

Supported Media Types
Query Parameters
  • Specify the name of the application instance name to get all the provisioned accounts.
  • Attributes to be returned in the result.Comma-separated attributes are accepted. Sample value for attributes is "accountName, accountStatus, accoutType, resource, applicationInstance"
  • Search filter to get the records. SCIM filter is accepted. There should not be any spaces for attribute value. If you want to pass space in between attribute values then replace it with "::". Sample value for filter is accountStatus eq Provisioned".
  • The user ID query parameter enables to get the accounts for the specified user.
Back to Top

Response

Supported Media Types

200 Response

Successful
Headers
Body ()
Root Schema : BulkAccountGetResponse
Type: object
Show Source
Nested Schema : accounts
Type: array
Show Source
Nested Schema : BulkAccountGetResponseInstance
Type: object
Show Source
Nested Schema : EntityReference
Type: object
Show Source
Nested Schema : LinkDataInstances
Type: object
Show Source

401 Response

Unauthorized

404 Response

Resource not found

500 Response

Internal Server Error

Default Response

Unexpected error
Back to Top

Examples

This example retrieves all the accounts for a given user. The information shown here is against a pseudo system and serves as a prototype.

cURL Example

curl  -H "Content-Type: application/json"  -X GET  -u username:password  
https://pseudo.com/iam/governance/selfservice/api/v1/accounts?userId=82

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
    "links": [
        {
            "rel": "self",
            "href": "http://pseudo.com/iam/governance/selfservice/api/v1/accounts?
userId=82&offset=1&limit=10"
        },
        {
            "rel": "first",
            "href": "http://pseudo.com/iam/governance/selfservice/api/v1/accounts?
userId=82&offset=1&limit=10"
        }
    ],
    "count": 2
    "hasMore": false,
    "totalResult": -1,
    "accounts": [
        {
            "links": [
                {
                    "rel": "self",
                    "href": "http://pseudo.com/iam/governance/selfservice/api/v1/accounts/2"
                }
            ],
            "id": "2",
            "name": "Test5520190311",
            "userId": "82",
            "appInstanceId": "1",
            "requestId": "",
            "fields": [
                {
                    "name": "Status",
                    "value": "Provisioned"
                },
                {
                    "name": "Policy Key",
                    "value": ""
                },
                {
                    "name": "Provisioned By",
                    "value": "1"
                },
                {
                    "name": "Risk Summary",
                    "value": 0
                },
                {
                    "name": "Account Data",
                    "value": []
                },
                {
                    "name": "Provisioned-On Date",
                    "value": "2019-03-11T22:43:11Z"
                },
                {
                    "name": "Process Instance Key",
                    "value": "201"
                },
                {
                    "name": "Valid From Date",
                    "value": "2019-03-11T22:43:11Z"
                },
                {
                    "name": "Account Description",
                    "value": "Test5520190311"
                },
                {
                    "name": "Account Type",
                    "value": "Primary"
                },
                {
                    "name": "Normalize Data",
                    "value": []
                }
            ]
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "http://pseudo.com/iam/governance/selfservice/api/v1/accounts/1"
                }
            ],
            "id": "1",
            "name": "test5520180311",
            "userId": "82",
            "appInstanceId": "2",
            "requestId": "",
            "fields": [
                {
                    "name": "Status",
                    "value": "Provisioning"
                },
                {
                    "name": "Policy Key",
                    "value": ""
                },
                {
                    "name": "Provisioned By",
                    "value": "1"
                },
                {
                    "name": "Risk Summary",
                    "value": 0
                },
                {
                    "name": "Account Data",
                    "value": []
                },
                {
                    "name": "Provisioned-On Date",
                    "value": "2019-03-11T22:42:01Z"
                },
                {
                    "name": "Process Instance Key",
                    "value": "200"
                },
                {
                    "name": "Valid From Date",
                    "value": "2019-03-11T22:42:01Z"
                },
                {
                    "name": "Account Description",
                    "value": "test5520180311"
                },
                {
                    "name": "Account Type",
                    "value": "Unknown"
                },
                {
                    "name": "Normalize Data",
                    "value": []
                }
            ]
        }
    ]
}
Back to Top