导出用户API(JSON)
此API用于通过JSON格式导出用户信息。
HTTP 方法
GET
URI
https://(子域名).cybozu.cn/v1/users.json
请求头部
头部 | 值和说明 |
---|---|
X-Cybozu-Authorization | 值为“登录名:密码”通过BASE64编码之后的字符。 |
Authorization | 使用Basic验证时,值为“Basic”和“登录名:密码”通过BASE64编码之后的字符。 |
// Sample X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU= Authorization: Basic QWRtaW5pc3RyYXRvcjpjeWJvenU=
请求参数
参数名称 | 要指定的值 | 必须 | 说明 |
---|---|---|---|
ids | 数组 | 可省略(省略时最大100)。 | 要获取的用户的ID列表。 |
codes | 数组 | 可省略(省略时最大100)。 | 要获取的code列表。 |
offset | 数值 | 可省略(省略时0)。 | 偏移量。 |
size | 数值 | 可省略(省略时最大100)。 | 获取条数。 |
请求范例
※ids和codes都指定时,将报错。
查询字符串
ids[0]=1&ids[1]=2&ids[2]=3&offset=0&size=100
包含请求头部的字符串
GET /v1/users.json?ids[0]=1&ids[1]=2&ids[2]=3&offset=0&size=100 HTTP/1.1 Host: example.cybozu.com:443 X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU= Authorization: Basic QWRtaW5pc3RyYXRvcjpjeWJvenU=
Content-Type头不需要。
应答
key | 类型 | 说明 |
---|---|---|
user | user型 | 用户信息 |
{ "users": [ { "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:00Z", "name": "a", "phone": "", "primaryOrganization": null, "sortOrder": 2147483647, "surName": "a", "surNameReading": "", "timezone": "Asia/Shanghai", "url": "", "valid": true }, { "birthDate": null, "callto": "", "code": "Administrator", "ctime": "2013-07-19T08:16:00Z", "customItemValues": [ { "code": "item1", "value": "adminitem1" }, { "code": "secret", "value": "adminitem2" } ], "description": "", "email": "", "employeeNumber": "", "extensionNumber": "", "givenName": "", "givenNameReading": "", "id": "7532782697181632512", "joinDate": null, "localName": "", "localNameLocale": "zh", "locale": "", "mobilePhone": "", "mtime": "2013-07-22T08:13:00Z", "name": "Administrator", "phone": "", "primaryOrganization": null, "sortOrder": 2147483647, "surName": "", "surNameReading": "", "timezone": "Asia/Shanghai", "url": "", "valid": true } ] }
代码范例
用curl发送请求的范例 :
curl -X GET 'https://sample.cybozu.cn/v1/users.json?codes%5B0%5D=fei-chen&codes%5B1%5D=shijie-zhou' \ -H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU='
访问权限
所有用户均可访问。
※kintone的来宾用户不可访问。