Query User Permission

Query user permission.

Request URL

GET {base_url}/user/openapi/user/v1/users/resource_list

Request parameters

Headers
Parameter Required Description
User-Agent Yes Provide information about the user agent, such as the type of web browser, operating system, software version, etc., so as to help Yeastar Partner Portal to identify the user or the application that is making the request.

Example: User-Agent: OpenAPI.

Authorization Yes Pass the access token in the header, so as to authenticate the API request.

Format: Bearer {access_token}.

Query parameters
Parameter Required Type Description
userId No String

The unique ID of the user whose permissions you want to query.

Note:
  • To query your own permission, do not pass this parameter.
  • To query a subordinate user's permissions, obtain subordinate user's ID using Query Subordinate User List interface.
  • To query your colleague's or a subordinate user's colleague's permissions, obtain colleague ID using the Query Colleague List interface.

Response parameters

Parameter Type Description
code String The response message of the API request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

requestId String The unique ID of the request, which can be used to quickly locate the request.
result Array<Details> The list of available permissions.
status Integer The HTTP status code of the API request.
Details
Parameter Type Description
id String The unique ID of the permission.
parentId String The unique ID of the parent permission.
permissionCode String The code that identifies the permission.
type String The permission type.
  • menu
  • button
name String The permission name.
treeSort Integer The display order of the permission.
status String The status of the permission.
children Array<Object> The list of child permissions.

Example

Request example

GET /user/openapi/user/v1/users/resource_list?userId=3525087957434159104 HTTP/1.1
Host: openapi.partner.yeastar.com
User-Agent: OpenAPI
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmVzMSJdLCJYLU1TLVVTRVIiOiJ7XCJleHByXCI6XCIwXCIsXCJ0eXBlXCI6XCJwYXJ0bmVyXCIsXCJ1Y0lkXCI6XCIzMDc2OTEzNjQ0ODkwODMyODk2XCIsXCJ1c2VyQ29kZVwiOlwiRGlzdHJpYnV0b3JcIixcInVzZXJJZFwiOlwiMzA3NjkxMzY0NDkxNTk5ODcyMFwiLFwidXNlcm5hbWVcIjpcImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbVwifSIsInVzZXJfbmFtZSI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE3Mzk1MzIwNjQsInRva2VuX3R5cGUiOiJvcGVuYXBpIiwianRpIjoibXVSZDFEb2JOYkpmUUJORXAxa3JHcHZtcXJNPSIsImF1dGhvcml0aWVzIjpbIjc3Il0sImNsaWVudF9pZCI6ImFjMGYyZTViZWU3NmI2ZDdmNDU0NTY5NmMyNGZjMWYzIn0.h8x-JgOmB-as-GQJ4CWKdxXQ21z_3PPSfm1G87dgoNQ

Response example

{
    "code": "success",
    "detailMessage": "",
    "requestId": "7bd56464faa552af1e3e054fd7651789",
    "result": [
        {
            "children": [],
            "id": "8",
            "name": "Dashboard",
            "parentId": "0",
            "permissionCode": "dashboard",
            "status": "enable",
            "treeSort": 1000,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": "484",
                    "name": "Trial",
                    "parentId": "10",
                    "permissionCode": "client_purchase.purchase.trial",
                    "status": "enable",
                    "treeSort": 1,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "483",
                    "name": "Purchase + Trial",
                    "parentId": "10",
                    "permissionCode": "client_purchase.purchase.purchase_trial",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                }
            ],
            "id": "10",
            "name": "Purchase",
            "parentId": "0",
            "permissionCode": "client_purchase.purchase",
            "status": "enable",
            "treeSort": 997,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": "405",
                    "name": "Release",
                    "parentId": "22",
                    "permissionCode": "client_products.release",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "407",
                    "name": "Switch OEM ID",
                    "parentId": "22",
                    "permissionCode": "client_products.switchOem",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "334",
                    "name": "Move to Turnkey",
                    "parentId": "22",
                    "permissionCode": "client_products.move_turnkey",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "409",
                    "name": "Bulk Edit",
                    "parentId": "22",
                    "permissionCode": "client_products.bulk_edit",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "297",
                    "name": "Associated",
                    "parentId": "22",
                    "permissionCode": "client_products.associated_user",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "295",
                    "name": "Export",
                    "parentId": "22",
                    "permissionCode": "client_products.export",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "293",
                    "name": "Product Detail",
                    "parentId": "22",
                    "permissionCode": "client_products.detail",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "292",
                    "name": "Instance View",
                    "parentId": "22",
                    "permissionCode": "client_products.instance.list",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "291",
                    "name": "Product View",
                    "parentId": "22",
                    "permissionCode": "client_products.list",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "367",
                    "name": "Delete",
                    "parentId": "22",
                    "permissionCode": "client_products.delete",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "369",
                    "name": "Batch Enable Auto Renewal",
                    "parentId": "22",
                    "permissionCode": "client_products.batch_auto_renew",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "373",
                    "name": "Send PBX Activation Email",
                    "parentId": "22",
                    "permissionCode": "client_products.send_pbx_activation_email",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                },
                {
                    "children": [],
                    "id": "374",
                    "name": "Change Product Owner",
                    "parentId": "22",
                    "permissionCode": "client_products.change_product_owner",
                    "status": "enable",
                    "treeSort": 0,
                    "type": "button"
                }
            ],
            "id": "22",
            "name": "My Products",
            "parentId": "0",
            "permissionCode": "client_products",
            "status": "enable",
            "treeSort": 996,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [
                        {
                            "children": [],
                            "id": "205",
                            "name": "View",
                            "parentId": "19",
                            "permissionCode": "client_orders_billing.orders.view_list",
                            "status": "enable",
                            "treeSort": 1000,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "365",
                            "name": "Export Invoice",
                            "parentId": "19",
                            "permissionCode": "client_orders_billing.orders.export_invoice",
                            "status": "enable",
                            "treeSort": 990,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "207",
                            "name": "Export Order",
                            "parentId": "19",
                            "permissionCode": "client_orders_billing.orders.export",
                            "status": "enable",
                            "treeSort": 980,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "210",
                            "name": "Cancel Order",
                            "parentId": "19",
                            "permissionCode": "client_orders_billing.orders.cancel",
                            "status": "enable",
                            "treeSort": 950,
                            "type": "button"
                        }
                    ],
                    "id": "19",
                    "name": "Orders",
                    "parentId": "18",
                    "permissionCode": "client_orders_billing.orders",
                    "status": "enable",
                    "treeSort": 1000,
                    "type": "menu"
                },
                {
                    "children": [
                        {
                            "children": [],
                            "id": "214",
                            "name": "View",
                            "parentId": "20",
                            "permissionCode": "client_orders_billing.transaction.view_list",
                            "status": "enable",
                            "treeSort": 1000,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "215",
                            "name": "Export",
                            "parentId": "20",
                            "permissionCode": "client_orders_billing.transaction.export",
                            "status": "enable",
                            "treeSort": 990,
                            "type": "button"
                        }
                    ],
                    "id": "20",
                    "name": "Transaction",
                    "parentId": "18",
                    "permissionCode": "client_orders_billing.transaction",
                    "status": "enable",
                    "treeSort": 900,
                    "type": "menu"
                },
                {
                    "children": [],
                    "id": "383",
                    "name": "Auto Renewal Management",
                    "parentId": "18",
                    "permissionCode": "client_orders_billing.auto_renew",
                    "status": "enable",
                    "treeSort": 800,
                    "type": "menu"
                }
            ],
            "id": "18",
            "name": "Orders and Billing",
            "parentId": "0",
            "permissionCode": "client_orders_billing",
            "status": "enable",
            "treeSort": 995,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": "344",
                    "name": "Promotions",
                    "parentId": "320",
                    "permissionCode": "client_business.promotions",
                    "status": "enable",
                    "treeSort": 999,
                    "type": "menu"
                },
                {
                    "children": [],
                    "id": "328",
                    "name": "Partner Program",
                    "parentId": "320",
                    "permissionCode": "client_business.partner_program",
                    "status": "enable",
                    "treeSort": 998,
                    "type": "menu"
                },
                {
                    "children": [
                        {
                            "children": [],
                            "id": "315",
                            "name": "Project Add",
                            "parentId": "321",
                            "permissionCode": "client_business.projects.project.add",
                            "status": "enable",
                            "treeSort": 1000,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "316",
                            "name": "Export",
                            "parentId": "321",
                            "permissionCode": "client_business.projects.export",
                            "status": "enable",
                            "treeSort": 990,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "318",
                            "name": "Update Status",
                            "parentId": "321",
                            "permissionCode": "client_business.projects.update.status",
                            "status": "enable",
                            "treeSort": 970,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "319",
                            "name": "Project Edit",
                            "parentId": "321",
                            "permissionCode": "client_business.projects.project.edit",
                            "status": "enable",
                            "treeSort": 960,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "329",
                            "name": "View",
                            "parentId": "321",
                            "permissionCode": "client.projects.project.list",
                            "status": "enable",
                            "treeSort": 950,
                            "type": "button"
                        }
                    ],
                    "id": "321",
                    "name": "Projects",
                    "parentId": "320",
                    "permissionCode": "client_business.projects",
                    "status": "enable",
                    "treeSort": 990,
                    "type": "menu"
                }
            ],
            "id": "320",
            "name": "Business",
            "parentId": "0",
            "permissionCode": "client_business",
            "status": "enable",
            "treeSort": 993,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": "30",
                    "name": "Marketing Resources",
                    "parentId": "29",
                    "permissionCode": "client_resources.marketing_resources",
                    "status": "enable",
                    "treeSort": 988,
                    "type": "menu"
                },
                {
                    "children": [
                        {
                            "children": [],
                            "id": "32",
                            "name": "Software Certificate",
                            "parentId": "31",
                            "permissionCode": "client_resources.certificate_lookup.software_certificate",
                            "status": "enable",
                            "treeSort": 890,
                            "type": "menu"
                        },
                        {
                            "children": [],
                            "id": "33",
                            "name": "Technical Certificate",
                            "parentId": "31",
                            "permissionCode": "client_resources.certificate_lookup.technical_certificate",
                            "status": "enable",
                            "treeSort": 880,
                            "type": "menu"
                        },
                        {
                            "children": [],
                            "id": "34",
                            "name": "Warranty Lookup",
                            "parentId": "31",
                            "permissionCode": "client_resources.certificate_lookup.warranty_lookup",
                            "status": "enable",
                            "treeSort": 870,
                            "type": "menu"
                        }
                    ],
                    "id": "31",
                    "name": "Certificate Lookup",
                    "parentId": "29",
                    "permissionCode": "client_resources.certificate_lookup",
                    "status": "enable",
                    "treeSort": 900,
                    "type": "menu"
                }
            ],
            "id": "29",
            "name": "Resources",
            "parentId": "0",
            "permissionCode": "client_resources",
            "status": "enable",
            "treeSort": 990,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [
                        {
                            "children": [],
                            "id": "216",
                            "name": "View",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.view_list",
                            "status": "enable",
                            "treeSort": 1000,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "217",
                            "name": "Add",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.add",
                            "status": "enable",
                            "treeSort": 990,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "218",
                            "name": "Edit",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.edit",
                            "status": "enable",
                            "treeSort": 980,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "219",
                            "name": "Detail",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.view_detail",
                            "status": "enable",
                            "treeSort": 970,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "226",
                            "name": "Active Email",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.active",
                            "status": "enable",
                            "treeSort": 950,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "229",
                            "name": "Assigned",
                            "parentId": "44",
                            "permissionCode": "client_user.partners.assigned",
                            "status": "enable",
                            "treeSort": 940,
                            "type": "button"
                        }
                    ],
                    "id": "44",
                    "name": "Partners",
                    "parentId": "43",
                    "permissionCode": "client_user.partners",
                    "status": "enable",
                    "treeSort": 1000,
                    "type": "menu"
                },
                {
                    "children": [
                        {
                            "children": [],
                            "id": "220",
                            "name": "View",
                            "parentId": "45",
                            "permissionCode": "client_user.colleagues.view_list",
                            "status": "enable",
                            "treeSort": 1000,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "221",
                            "name": "Add",
                            "parentId": "45",
                            "permissionCode": "client_colleagues.save",
                            "status": "enable",
                            "treeSort": 990,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "222",
                            "name": "Edit",
                            "parentId": "45",
                            "permissionCode": "client_user.colleagues.edit",
                            "status": "enable",
                            "treeSort": 980,
                            "type": "button"
                        },
                        {
                            "children": [],
                            "id": "227",
                            "name": "Delete",
                            "parentId": "45",
                            "permissionCode": "client_user.colleagues.delete",
                            "status": "enable",
                            "treeSort": 970,
                            "type": "button"
                        }
                    ],
                    "id": "45",
                    "name": "Collegues",
                    "parentId": "43",
                    "permissionCode": "client_user.colleagues",
                    "status": "enable",
                    "treeSort": 990,
                    "type": "menu"
                }
            ],
            "id": "43",
            "name": "User",
            "parentId": "0",
            "permissionCode": "client_user",
            "status": "enable",
            "treeSort": 988,
            "type": "menu"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": "330",
                    "name": "Preferences",
                    "parentId": "331",
                    "permissionCode": "client_system.client_preferences",
                    "status": "enable",
                    "treeSort": 1000,
                    "type": "menu"
                },
                {
                    "children": [],
                    "id": "366",
                    "name": "API",
                    "parentId": "331",
                    "permissionCode": "client_system.client_api",
                    "status": "enable",
                    "treeSort": 999,
                    "type": "menu"
                }
            ],
            "id": "331",
            "name": "System",
            "parentId": "0",
            "permissionCode": "client_system",
            "status": "enable",
            "treeSort": 986,
            "type": "menu"
        }
    ],
    "status": 200
}