导出组织内的用户的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 | 类型 | 内容 |
---|---|---|
userTitles | userTitle类型数组 | 所属于组织的用户及其职务的列表 |
{ "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的来宾用户不可访问。