Listing resource authorizations
Use this method to get a list of resource authorizations. You can specify the ID of a specific authorization object in the request, and you can also use a number of query parameters to refine the request. For example, get a list that details the users and user groups that have access to a specific data source.
Method
GET.
Resource URI
/ibm/ioc/api/authorization-service/authorizations
For example, to get a resource authorization object that has an ID of
1:
https://web-server.cn.example.com/ibm/ioc/api/authorization-service/authorizations/1
Path parameters
| Name | Type | Description |
|---|---|---|
| id | Number | Optional parameter to specify the ID of a specific authorization object to get. If the parameter is not specified, all resource authorization objects are listed. |
Query parameters
| Name | Type | Description |
|---|---|---|
| identity | String | Optional parameter to specify the ID of the user or user group that the resource authorizations are for. |
| identityType | String | Optional parameter to specify the identity type. "U" is for user and "G" is for a user group. |
| includeGroups | Boolean | Optional parameter to specify whether authorization objects for user groups only are returned. If the value is set to "true", then authorizaton objects for user groups are included in the returned list, otherwise, if the value is set to "false", authorization objects for users only are returned. |
| locale | String | Optional parameter to specify the locale language of the returned authorizations. |
| resourceId | String | Optional parameter to specify the ID of the resource that the authorizations are for. |
| resourceType | String | Optional parameter to specify the type of the resource. For example, a data source. |
Response properties
If an authorization object ID is included in the service request, then a single object is
returned. Otherwise, an array containing authorization objects is returned.
| Name | Type | Description |
|---|---|---|
| id | Number | The resource ID. |
| identity | String | The ID of the user or user group that the authorization is for. |
| identityType | String | The identity type. "U" is for user and "G" is for a user group. |
| lastUpdateDate | Number | The timestamp that indicates when the authorization was last updated. |
| resourceId | String | The ID of the resource that the authorization is for. |
| resourceType | String | The type of the resource. For example, a data source. |
| writeAccess | Boolean | A value of "true" indicates that the identity has write access to the resource. |
Sample response content
The following sample response is from a service call to get the authorization details for a
specified resource that has an ID of 1.
[
{
"id": 57,
"lastUpdateDate": 1538056046400,
"resourceId": 1,
"resourceType": "datasource",
"identity": "siteamdin",
"identityType": "U",
"writeAccess": true
}
{
"id": 2,
"lastUpdateDate": 1538056046569,
"resourceId": 1,
"resourceType": "datasource",
"identity": "CitySupervisor",
"identityType": "G",
"writeAccess": true
}
]
HTTP return codes
The HTTP GET method returns one of the following status codes:
| Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 500 | Internal server error |