Get Available Roles
Returns all the application and predefined roles that are available for an Oracle Fusion Cloud Enterprise Performance Management service. Additionally, roles can be retrieved based on the specified type (predefined or application).
This API is synchronous and returns the outcome of the operation in the response. Any non-zero status indicates failure of getting available roles.
This REST API is version v2.
Required Roles
Service Administrator or Access Control – Manage
REST Resource
GET
/interop/rest/security/v2/role/getavailableroles?type=<type>
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for Cloud EPM REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Table 12-95 Tasks for Getting Available Roles
Task | Request | REST Resource |
---|---|---|
Get Available Roles | GET | /interop/rest/security/v2/role/getavailableroles?type=<type> |
Request
Supported Media Types: application/json
Table 12-96 Request Parameter
Name | Description | Type | Required | Default |
---|---|---|---|---|
type |
When When When |
Query | No | All application and predefined roles |
Response
Supported Media Types: application/json
Table 12-97 Response Parameters
Parameters | Description |
---|---|
links |
Detailed information about the link |
status |
Status of the operation
|
error |
Detailed information about the error |
details |
Records matching the request |
Examples of Response Body
The following show examples of the response body in JSON format.
Example 1: REST API Completes without Errors when no Query Parameter is Specified
{
"links": {
"href": "https://<BASE URL>/interop/rest/security/v2/role/getavailableroles",
"action": "GET"
},
"status": 0,
"error": null,
"details": [
{
"name": "Ad Hoc - Create",
"id": "HP:0016"
},
{
"name": "Ad Hoc - Read Only User",
"id": "HP:0017"
},
{
"name": "Ad Hoc - User",
"id": "HP:0015"
},
{
"name": "Announcements - Manage",
"id": "HP:0021"
},
{
"name": "User",
"id": "HUB:003"
},
{
"name": "Viewer",
"id": "HUB:004"
},
...
]
}
Example 2: REST API Completes without Errors, when Query Parameter
type=application
is Specified
{
"links": {
"href": " https://<BASE URL>/interop/rest/security/v2/role/getavailableroles?type=application",
"action": "GET"
},
"status": 0,
"error": null,
"details": [
{
"name": "Ad Hoc - Create",
"id": "HP:0016"
},
{
"name": "Ad Hoc - Read Only User",
"id": "HP:0017"
},
{
"name": "Ad Hoc - User",
"id": "HP:0015"
},
{
"name": "Announcements - Manage",
"id": "HP:0021"
}
]
}
Example 3: REST API Completes without Errors, when Query Parameter
type=predefined
is Specified
{
"links": {
"href": " https://<BASE URL>/interop/rest/security/v2/role/getavailableroles?type=predefined",
"action": "GET"
},
"status": 0,
"error": null,
"details": [
{
"name": "User",
"id": "HUB:003"
},
{
"name": "Viewer",
"id": "HUB:004"
}
. . .
]
}
Example 4: REST API Completes with Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/role/getavailableroles",
"action": "GET"
},
"status": 1,
"error": {
"errorcode": "EPMCSS-21192",
"errormessage": "Failed to get available roles. Authorization failed. Please provide valid authorized user."
},
"details": null
}
Sample cURL Command Basic Auth
curl -X GET -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' 'https://<BASE-URL>/interop/rest/security/v2/role/getavailableroles'
curl -X GET -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json''https://<BASE-URL>/interop/rest/security/v2/role/getavailableroles?type=application'
Sample cURL Command OAuth 2.0
curl -X GET --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 'Content-Type: application/json' 'https://<BASE-URL>/interop/rest/security/v2/role/getavailableroles'
curl -X GET --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 'Content-Type: application/json' 'https://<BASE-URL>/interop/rest/security/v2/role/getavailableroles?type=application'