Skip to content

User Roles

  • Endpoint Path: /api/v2/global/roles
  • Method: GET
  • Request: Query

Headers Optional Parameter

Parameter NamePublic Mode (Required)Private Mode (Required)
X-Fresns-Aidoptionalrequired
X-Fresns-Aid-Tokenoptionalrequired
X-Fresns-Uidoptionalrequired
X-Fresns-Uid-Tokenoptionalrequired

Query Params

Parameter NameTypeRequiredDescription
idsStringoptionalRole rid, separated by English commas for multiple roles
typeNumberoptional1 Management personnel
2 System settings
3 User operation
Leave empty to output all
statusBooleanoptional0 Disable role
1 Enable role
Leave empty to output all
pageSizeNumberoptionalNumber of items per page (default 15 items)
pageNumberoptionalPage number (default 1)

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        "pagination": {
            "total": "Number / How much data in total",
            "pageSize": "Number / How much data on each page",
            "currentPage": "Number / Current page number",
            "lastPage": "Number / Last page number"
        },
        "list": [
            {
                "type": "Number / Role Type",
                "rid": "Number / Role ID",
                "nicknameColor": "String / Nickname color for users with this role",
                "name": "String / Role name",
                "nameDisplay": "Boolean / Whether to display role name",
                "icon": "String / Role icon URL",
                "iconDisplay": "Boolean / Whether to display role icon",
                "permission": [
                    // All content from roles table permission field
                ],
                "status": "Boolean / Enabled status",
            }
        ]
    }
}

Released under the Apache-2.0 License