Get Department's Users

Gets information of Users that belong to a Department, including their Job title.

MethodGET
URLhttps://{subdomain}.kintone.com/v1/organization/users.json
Authentication Password Authentication, Session Authentication
Content-Typeapplication/json (not needed if specifying the query with a query string)

Contents

Permissions

All users other than Guest Users can use this API.

Request Parameters

Parameter Value Required Description
code String Yes The department code.
offset Integer Optional The offset.
If ignored, this value is 0.
size Integer Optional The maximum number of users to get from the Department.
If ignored, this value is 100.

Sample Request

JavaScript (using Kintone REST API Request)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var body = {
  'code': 'sample_organization_code',
  'offset': 0,
  'size': 100
};
kintone.api(kintone.api.url('/v1/organization/users.json', true), 'GET', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

XMLHttpRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
var params = '?code=sample_organization_code&offset=0&size=50';
var url = 'https://{subdomain}.kintone.com/v1/organization/users.json' + params;
console.log(url);
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send();

Response Parameters

Parameter Type Description
userTitles Array A list of Users and their Job titles that belong to the Department, as userTitle types.

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
  "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": "en",
        "locale": "",
        "mobilePhone": "",
        "mtime": "2013-07-22T09:00:45Z",
        "name": "a",
        "phone": "",
        "primaryOrganization": null,
        "sortOrder": 2147483647,
        "surName": "a",
        "surNameReading": "",
        "timezone": "America/Los_Angeles",
        "url": "",
        "valid": true
      },
      "title": {
        "code": "leader",
        "description": "leader",
        "id": "1",
        "name": "leader"
      }
    },
    {
      "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": "en",
        "locale": "",
        "mobilePhone": "",
        "mtime": "2013-07-22T09:00:45Z",
        "name": "a",
        "phone": "",
        "primaryOrganization": null,
        "sortOrder": 2147483647,
        "surName": "a",
        "surNameReading": "",
        "timezone": "America/Los_Angeles",
        "url": "",
        "valid": true
      },
      "title": null
    }
  ]
}