Get Groups

Gets information of groups.

MethodGET
URLhttps://{subdomain}.kintone.com/v1/groups.json
AuthenticationPassword 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
ids Array Optional A list of Group IDs, as ID types .
Up to 100 ids can be specified.
codes Array Optional  A list of Group Codes, as Strings.
Up to 100 codes can be specified.
offset Integer Optional  The offset.
If ignored, this value is 0.
size Integer Optional  The maximum number of Group information to get.
If ignored, this value is 100.

*If ids and codes are both ignored, up to 100 ids will be responded in ascending order of id.

**If ids and codes are both set, an error will return. Only one can be set.

Sample Request

JavaScript (using Kintone REST API Request )

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var body = {
  'ids': [1, 2, 3],
  'offset': 0,
  'size': 100
};
kintone.api(kintone.api.url('/v1/groups', 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 = '?ids[0]=1&ids[1]=2&ids[2]=3&offset=0&size=100';
var url = 'https://{subdomain}.kintone.com/v1/groups.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
groups Array A list of department information, as group types , in ascending order of id.

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "groups": [
    {
      "id": "1",
      "code": "1",
      "name": "Officer",
      "description": ""
    },
    {
      "id": "2",
      "code": "general_manager",
      "name": "General Manager",
      "description": ""
    },
    {
      "id": "7532782697181632513",
      "code": "everyone",
      "name": "Everyone",
      "description": null
    }
  ]
}