Export selected roles
In this example, you can learn how to retrieve specific roles and their privileges from the source Tuum environment.
Use case
In this example, we will export specific roles and privileges.
Use case data
API parameters with values
The role codes we're exporting roles and privileges for are: ACCOUNTANT
and TEST_LT
.
The system will export only roles and associated privileges with a valid validity range.
Sample API call
To export specific roles and privileges, make the following API call.
Sample request
Below is an example request body of the API call for export roles.
{
"roleCodes": [
"ACCOUNTANT",
"TEST_LT"
]
}
curl --location 'https://auth-api.sandbox.tuumplatform.com/api/v1/roles/privileges/export' \
--header 'Accept-Language: en-GB' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiTGF1cmEgVGVlbcOkZ2kiLCJlbXBsb3llZUlkIjoiSUQtMTA1MCIsInRlbmFudENvZGUiOiJNQi5FVSIsImV4cGlyeURUaW1lIjoiMjAyNS0wMy0xOFQxMDo0NjoxMSIsImV4cCI6MTc0MjI5NDc3MSwicm9sZXMiOlsiQURNSU4iXX0.zD1buC7eTHM0cDgGMhThq1II6TUY3DdmfrHzDphcBdE' \
--header 'Content-Type: application/json' \
--data '{
"roleCodes": [
"ACCOUNTANT",
"TEST_LT"
]
}'
Sample response
Below you find an example response body to the API call above.
Response
{
"errors": null,
"validationErrors": null,
"data": {
"rolesWithPrivileges": [
{
"roleCode": "ACCOUNTANT",
"privilegeNames": [
"ADD_PERSON",
"APPROVE_APPLICATIONS",
"DISBURSE_LOAN",
"EDIT_CONTRACT",
"EDIT_LOAN_PRODUCTS",
"EDIT_PERSON",
"MANAGE_USERS",
"SEARCH_CONTRACT_DOCUMENTS",
"VIEW_GL_JOURNAL",
"VIEW_LOAN_CONTRACT",
"VIEW_LOAN_PRODUCTS",
"VIEW_PERSON",
"VIEW_PERSON_ADDITIONAL_CONTACT",
"VIEW_PERSON_GROUP_TYPE"
],
"valid": true
},
{
"roleCode": "TEST_LT",
"privilegeNames": [
"MANAGE_USERS",
"READ_RESTRICTED_DATA",
"VIEW_EXTERNAL_CONTRACTS",
"VIEW_FOUREYE_REVIEW_RULE",
"VIEW_PERSON",
"VIEW_PERSON_GROUP_TYPE",
"VIEW_REVIEW_APPROVALS_CONFIGURATION"
],
"valid": true
}
]
}
}
Result
The selected valid roles ACCOUNTANT and TEST_LT with related privileges have been exported.