导出组织内的用户的API

aki发表于:2019年11月15日 09:34:51更新于:2023年04月28日 15:19:13

导出组织内的用户的API(仅输出JSON)

此API用于通过JSON格式获取所指定的组织内的用户。

HTTP 方法

GET

URI

https://(子域名).cybozu.cn/v1/organization/users.json

请求头部

头部值和说明
X-Cybozu-Authorization值为“登录名:密码”通过BASE64编码之后的字符。
Authorization使用Basic验证时,值为“Basic”和“登录名:密码”通过BASE64编码之后的字符。
// Sample
X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU=
Authorization: Basic QWRtaW5pc3RyYXRvcjpjeWJvenU=

请求参数

参数名称要指定的类型必须说明
code字符串必须组织代码
offset数值可省略(省略时为0)偏移量
size数值可省略(省略时为100)大小

通过HTTP的查询字符串发送参数

查询字符串
code=Dev&offset=0&size=50
包含查询头部的字符串
GET /v1/organization/users.json?code=Dev&offset=0&size=50 HTTP/1.1
Host: example.cybozu.cn:443
X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU=
Authorization: Basic QWRtaW5pc3RyYXRvcjpjeWJvenU=
  • Content-Type头部不需要。

应答

key类型内容
userTitlesuserTitle类型数组所属于组织的用户及其职务的列表
{    
    "userTitles":[    
        {    
            "user":{    
                "birthDate":"2011-05-01",    
                "callto":"",    
                "code":"a",    
                "ctime":"2013-07-22T08:12:18Z",    
                "customItemValues":[    
                    {    
                        "code":"item1",    
                        "value":"aitem1"    
                    },    
                    {    
                        "code":"secret",    
                        "value":"aitem2"    
                    }    
                ],    
                "description":"",    
                "email":"",    
                "employeeNumber":"",    
                "extensionNumber":"",    
                "givenName":"",    
                "givenNameReading":"",    
                "id":"1",    
                "joinDate":"2013-01-01",    
                "localName":"",    
                "localNameLocale":"zh",    
                "locale":"",    
                "mobilePhone":"",    
                "mtime":"2013-07-22T09:00:45Z",    
                "name":"a",    
                "phone":"",    
                "primaryOrganization":null,    
                "sortOrder":2147483647,    
                "surName":"a",    
                "surNameReading":"",    
                "timezone":"Asia/Shanghai",    
                "url":"",    
                "valid":true    
            },    
            "title":{    
                "code":"leader",    
                "description":"带领团队",    
                "id":"1",    
                "name":"经理"    
            }    
        },    
        {    
            "user":{    
                "birthDate":"2011-05-01",    
                "callto":"",    
                "code":"b",    
                "ctime":"2013-07-22T08:12:18Z",    
                "customItemValues":[    
                    {    
                        "code":"item1",    
                        "value":"bitem1"    
                    },    
                    {    
                        "code":"secret",    
                        "value":"bitem2"    
                    }    
                ],    
                "description":"",    
                "email":"",    
                "employeeNumber":"",    
                "extensionNumber":"",    
                "givenName":"",    
                "givenNameReading":"",    
                "id":"1",    
                "joinDate":"2013-01-01",    
                "localName":"",    
                "localNameLocale":"zh",    
                "locale":"",    
                "mobilePhone":"",    
                "mtime":"2013-07-22T09:00:45Z",    
                "name":"a",    
                "phone":"",    
                "primaryOrganization":null,    
                "sortOrder":2147483647,    
                "surName":"a",    
                "surNameReading":"",    
                "timezone":"Asia/Shanghai",    
                "url":"",    
                "valid":true    
            },    
            "title":null    
        }    
    ]    
}

代码范例

用curl发送请求的范例 :

curl -X GET 'https://sample.cybozu.cn/v1/organization/users.json?code=Sales01' \
  -H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU='

访问权限

所有用户均可访问。

※kintone的来宾用户不可访问。