dingtalk.corp.role.list (获取企业角色列表)

获取企业角色列表

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
size Number 可选 20
  • 默认值:20
  • 分页大小
    offset Number 可选 0
  • 默认值:0
  • 分页偏移

    响应参数

    名称 类型 示例值 描述
    result Result {"hasMore":"false", "list":[{"name": "职务", roles:[{"name":"财务", "id":123}]}]} result
    • └ has_more
    • String
    • false
    • 分页是否还有数据
    • list
    • RoleGroups []
    • 角色分组列表
    • roles
    • Roles []
    • 角色列表
    • └ id
    • Number
    • 123
    • 角色ID
    • └ role_name
    • String
    • 财务
    • 角色名称
    • └ group_name
    • String
    • 职务
    • 角色分组名称

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    DingTalkClient client = new DefaultDingTalkClient("https://eco.taobao.com/router/rest");
    CorpRoleListRequest req = new CorpRoleListRequest();
    req.setSize(20L);
    req.setOffset(0L);
    CorpRoleListResponse rsp = client.execute(req, access_token);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <dingtalk_corp_role_list_response>
        <result>
            <has_more>false</has_more>
            <list>
                <role_groups>
                    <roles>
                        <roles>
                            <id>123</id>
                            <role_name>财务</role_name>
                        </roles>
                    </roles>
                    <group_name>职务</group_name>
                </role_groups>
            </list>
        </result>
    </dingtalk_corp_role_list_response>

    异常示例

    • XML示例
    • JSON示例
    <error_response>
        <code>50</code>
        <msg>Remote service error</msg>
        <sub_code>isv.invalid-parameter</sub_code>
        <sub_msg>非法参数</sub_msg>
    </error_response>

    错误码解释

    错误码 错误描述 解决方案

    API工具

    如何获得此API

    FAQ

    返回
    顶部