Skip to content

User Roles

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

Headers Optional Parameter

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

Query Params

KeyTypeRequiredDescription
ridsStringoptionalRole rid, separated by English commas for multiple roles
statusBooleanoptional0 Disable role
1 Enable role
Null 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": [
            {
                "rid": "String / 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