Query Assignable Permissions

Queries the permissions that can be assigned to a user.

Request URL

GET {base_url}/uc-user/api/v1/user-permissions/assignable

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code No String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Query parameters
Parameter Required Type Description
applicationId Yes Integer

The ID of the application.

Valid value:

  • 1: Platform.
  • 2: Tenant.
  • 3: WebClient.
targetUserId No String The ID of the target user (for the editing scenario). You can obtain the ID using the Search Resellers interface.
subType No String

The sub type of the user (for the creation scenario):

Valid value:

  • SUPER
  • ADMIN
  • RESELLER
isPrimaryAccount No Boolean Whether the account is a primary account (for the creation scenario).
userType No String

The type of the user (for the creation scenario):

Valid value:

  • P_ACCOUNT
  • T_USER
ownerUserId No String The ID of the owner user, which explicitly specifies the parent primary account (optional for the creation scenario). If this parameter is not specified, the owner is derived from the operator. You can obtain the ID using the Search Resellers interface.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Array<Assignable_Permission_Node> The tree of permissions that can be assigned.
Assignable_Permission_Node
Parameter Type Description
id Integer The ID of the permission.
code String The code of the permission.
name String The name of the permission.
type String The type of the permission.
parentId Integer The ID of the parent permission.
isDefault Boolean Whether the permission is assigned by default.
isAssigned Boolean Whether the permission has been assigned to the target user.
children Array<Assignable_Permission_Node> The list of child permission nodes. The structure of a child node is the same as the structure of this table (recursive).

Example

Request example

GET /uc-user/api/v1/user-permissions/assignable?applicationId=1&targetUserId=2085315948849827842 HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJtdDEwMDBAbWFpbHN0YXIudG9wIiwiYXBwX2tleSI6Im9icWJUSWd1ZkJ5d3ZCNmF0VURmVDZpeDJvUlhUb0wzIiwiZ3JhbnRfdHlwZSI6Im9wZW5hcGkiLCJjbGllbnRfZXh0Ijp7ImRlc2NyaXB0aW9uIjoi56ys5LiJ5pa55ZCI5L2c5LyZ5Ly05bqU55SoIiwicGFydG5lciI6IuekuuS-i-WQiOS9nOS8meS8tCJ9LCJjbGllbnRfdHlwZSI6Im9wZW5hcGkiLCJleHAiOjE3OTIwNzI3NTcsImlhdCI6MTc5MjA1MTE1NywianRpIjoiOTVkOGM1YWMtNzg3MS00ZjlmLWFiOWUtYzFjOTBlYzU4N2M1IiwiY2xpZW50X2lkIjoibm92by1vcGVuLXBsYXRmb3JtIiwidXNlcl9leHQiOnsicm9sZUlkcyI6WzNdLCJzdHlwZSI6IkFETUlOIiwidGVuYW50Q29kZSI6bnVsbCwidHlwZSI6IlBfQUNDT1VOVCIsInVzZXJJZCI6MjA4NTMxNTk0ODg0OTgyNzg0MiwiZW1haWwiOiJtdDEwMDBAbWFpbHN0YXIudG9wIiwidXNlcm5hbWUiOiJtdDEwMDBAbWFpbHN0YXIudG9wIiwidWNJZCI6MjA4NTMxNTk0ODI4Nzc5MTEwNn19.AmC_hWm0Pa51VbO2YaQZF3gXofw5NQDi_njH-fPAi2r_kWc8PyxkK6vq212lTPHR-eDMY3CaXhUxptGNcUUXAHfbuFqHXBcLvZ1ggmMCYLlSpcsj9TBg3BULyvHOlJBEbO7b_OOBZi_fGG-Oe3e9m-EsdOjA150ZJKU9trq-QUqFndTvdMZV9JHDV2xpDwgKdT6v4xNhM9TaAT9_tLmOtSipIijx32ng8CIDd0l7jWYfrmwsjf32n0P232nXmKfdADjSuKAp8TNxc17ccFxt9k0aQlB9uyhGPjIdCHSK7hill2VbzVAGuVzj3b1AplQz2cAVmVhXqWqOfpfjM1tY9A

Response example

HTTP/1.1 200 OK
{
  "result": [
    {
      "id": 101003,
      "code": "platform:account",
      "name": "Account",
      "type": "PAGE",
      "isDefault": true,
      "isAssigned": true,
      "children": [
        {
          "id": 101012,
          "code": "platform:account:colleagues",
          "name": "Colleagues",
          "type": "PAGE",
          "parentId": 101003,
          "isDefault": true,
          "isAssigned": true,
          "children": [
            {
              "id": 101212,
              "code": "platform:account:colleagues:add",
              "name": "Add",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101216,
              "code": "platform:account:colleagues:delete",
              "name": "Delete",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101213,
              "code": "platform:account:colleagues:edit",
              "name": "Edit",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101217,
              "code": "platform:account:colleagues:export",
              "name": "Export",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101215,
              "code": "platform:account:colleagues:freeze",
              "name": "Freeze",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101214,
              "code": "platform:account:colleagues:resendActivationEmail",
              "name": "Resend Activation Email",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101211,
              "code": "platform:account:colleagues:view",
              "name": "View",
              "type": "BUTTON",
              "parentId": 101012,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            }
          ]
        },
        {
          "id": 101011,
          "code": "platform:account:resellers",
          "name": "Resellers",
          "type": "PAGE",
          "parentId": 101003,
          "isDefault": true,
          "isAssigned": true,
          "children": [
            {
              "id": 101203,
              "code": "platform:account:resellers:add",
              "name": "Add",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101207,
              "code": "platform:account:resellers:delete",
              "name": "Delete",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101204,
              "code": "platform:account:resellers:edit",
              "name": "Edit",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101208,
              "code": "platform:account:resellers:export",
              "name": "Export",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101206,
              "code": "platform:account:resellers:freeze",
              "name": "Freeze",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101205,
              "code": "platform:account:resellers:resendActivationEmail",
              "name": "Resend Activation Email",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            },
            {
              "id": 101201,
              "code": "platform:account:resellers:view",
              "name": "View",
              "type": "BUTTON",
              "parentId": 101011,
              "isDefault": true,
              "isAssigned": true,
              "children": []
            }
          ]
        }
      ]
    }
  ],
  "requestId": "48ef654638d4456ed5f7dd42727d8a05",
  "code": "200",
  "message": "SUCCESS"
}
Note:

The response is condensed. The result array contains 10 items.