应用 API
  1. 角色
应用 API
  • V3-beta(AI 友好)
    • 概述
    • 字段类型对照表
    • 筛选器使用指南
    • 错误码
    • 应用
      • 获取应用信息
    • 工作表
      • 获取工作表结构信息
      • 编辑工作表
      • 删除工作表
      • 新建工作表
    • 工作表行记录
      • 获取行记录列表
      • 获取行记录详情
      • 新建行记录
      • 更新行记录
      • 删除行记录
      • 批量新增行记录
      • 批量更新行记录
      • 批量删除行记录
      • 获取关联记录
      • 获取行记录透视数据
      • 获取记录分享链接
      • 获取行记录日志
      • 获取行记录讨论
    • 选项集
      • 获取选项集列表
      • 创建选项集
      • 编辑选项集
      • 删除选项集
    • 工作流
      • 获取流程列表
      • 获取流程详情
      • 触发流程
    • 角色
      • 获取角色列表
        GET
      • 创建角色
        POST
      • 获取角色详情
        GET
      • 删除角色
        DELETE
      • 添加角色成员
        POST
      • 移除角色成员
        DELETE
      • 成员退出所有角色
        DELETE
    • 公共查询
      • 查找成员
      • 查找部门
      • 获取地区信息
  • V2
    • 开发指南
    • 筛选器
    • 筛选器使用示例
    • 错误码
    • 应用
      • 获取应用信息
    • 工作表
      • 新建工作表
      • 获取工作表结构信息
      • 获取行记录列表
      • 新建行记录
      • 批量新建行记录
      • 获取行记录详情
      • 获取行记录详情
      • 更新行记录详情
      • 批量更新行记录详情
      • 删除行记录
      • 获取关联记录
      • 获取记录分享链接
      • 获取工作表总行数
      • 获取行记录日志
      • 获取行记录讨论
    • 角色
      • 创建角色
      • 退出应用
      • 删除角色
      • 添加角色成员
      • 移除应用角色成员
      • 获取角色列表
      • 获取角色详情
    • 选项集
      • 创建选项集
      • 获取选项集
      • 编辑选项集
      • 删除选项集
    • 公共查询
      • 获取地区信息
  1. 角色

创建角色

正式环境
https://api.mingdao.com
正式环境
https://api.mingdao.com
POST
/v3/app/roles
创建角色
信息包含:角色名称、描述、权限信息

请求参数

Header 参数

Body 参数application/json

示例
{
    "name": "string",
    "description": "string",
    "permissionScope": 80,
    "type": 0,
    "hideAppForMembers": true,
    "globalPermissions": {
        "addRecord": true,
        "share": true,
        "import": true,
        "export": true,
        "discuss": true,
        "systemPrint": true,
        "attachmentDownload": true,
        "log": true
    },
    "worksheetPermissions": [
        {
            "id": "string",
            "recordPermissionInViews": [
                {
                    "viewId": "string",
                    "read": true,
                    "edit": true,
                    "delete": true
                }
            ],
            "recordDataScope": {
                "read": 0,
                "edit": 0,
                "delete": 0
            },
            "worksheetActions": {
                "shareView": true,
                "import": true,
                "export": true,
                "discuss": true,
                "batchOperation": true
            },
            "recordActions": {
                "add": true,
                "share": true,
                "discuss": true,
                "systemPrint": true,
                "attachmentDownload": true,
                "log": true
            },
            "paymentActions": {
                "pay": "string"
            },
            "fieldPermissions": [
                {
                    "id": "string",
                    "add": true,
                    "read": true,
                    "edit": true,
                    "decrypt": true
                }
            ]
        }
    ],
    "pagePermissions": [
        {
            "id": "string",
            "enable": true
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mingdao.com/v3/app/roles' \
--header 'HAP-Appkey: {{appkey}}' \
--header 'HAP-Sign: {{sign}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "string",
    "description": "string",
    "permissionScope": 80,
    "type": 0,
    "hideAppForMembers": true,
    "globalPermissions": {
        "addRecord": true,
        "share": true,
        "import": true,
        "export": true,
        "discuss": true,
        "systemPrint": true,
        "attachmentDownload": true,
        "log": true
    },
    "worksheetPermissions": [
        {
            "id": "string",
            "recordPermissionInViews": [
                {
                    "viewId": "string",
                    "read": true,
                    "edit": true,
                    "delete": true
                }
            ],
            "recordDataScope": {
                "read": 0,
                "edit": 0,
                "delete": 0
            },
            "worksheetActions": {
                "shareView": true,
                "import": true,
                "export": true,
                "discuss": true,
                "batchOperation": true
            },
            "recordActions": {
                "add": true,
                "share": true,
                "discuss": true,
                "systemPrint": true,
                "attachmentDownload": true,
                "log": true
            },
            "paymentActions": {
                "pay": "string"
            },
            "fieldPermissions": [
                {
                    "id": "string",
                    "add": true,
                    "read": true,
                    "edit": true,
                    "decrypt": true
                }
            ]
        }
    ],
    "pagePermissions": [
        {
            "id": "string",
            "enable": true
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "data": {
        "id": "6825715d-92cc-4e15-83ce-8e39d1a667bc",
        "name": "新角色40",
        "roleType": 0,
        "desc": "",
        "users": [],
        "departments": [],
        "departmentTrees": [],
        "projectOrganizes": [],
        "jobs": []
    },
    "success": true
}
修改于 2025-09-05 07:02:57
上一页
获取角色列表
下一页
获取角色详情
Built with