Skip to content

Add Application-Side Role ​

Permissions ​

The identity management API is authorized by application. Before calling the API, you need to set API permissions for different applications. For details, see API Permissions.

Permission CodeDescription
app_role_allRead/Write permission for application-side role APIs
allRead/Write permission for all APIs

Request ​

Request Headers ​

Parameter NameNameRequiredTypeDescription
AuthorizationAuthorizationYesStringFormat: Bearer {access_token}
Content-TypeContent TypeYesStringFixed value: application/json; charset=utf-8

Request Example ​

json
{
    "code": "admin1",
    "name": "Administrator 1"
}

Request Parameters ​

Parameter NameNameRequiredTypeDescription
app_idApplication IDYesStringTarget application ID
codeApplication-side role codeYesStringUnique, max length 50
nameApplication-side role nameYesStringMax length 50

Response Example ​

Success Example ​

HTTP/1.1 200 OK

json
{
    "role_id": "20220420140745089-23E4-DFF0A1900"
}

Error Example ​

HTTP/1.1 400 Bad Request

json
{
    "error_code": " APP.ROLE.0005",
    "error_msg": "Application role code already exists"
}

Response Parameters ​

Parameter NameNameTypeDescription
role_idApplication role IDString

Error Codes ​

Status CodeError CodeChinese Error MessageEnglish Error MessageResolution
400APP.ROLE.0005应用角色编码已存在Application role code already existsPlease use a different application role code
400APP.OBJECTMODEL.0006未开启应用角色模型The application role model is not openedPlease check whether the application role model is enabled
400APP.0001应用不存在App does not existPlease check whether the application has been deleted

BambooCloud IDaaS Open Platform