Get User's Departments

Gets information of Departments that a User belongs to, and Job Title information related to the Department.

MethodGET
URLhttps://{subdomain}.kintone.com/v1/user/organizations.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
code String Yes The User’s code (log-in name).

Sample Request

JavaScript (using Kintone REST API Request )

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var body = {
  'code': 'sample_user_code'
};
kintone.api(kintone.api.url('/v1/user/organizations', 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_user_code';
var url = 'https://{subdomain}.kintone.com/v1/user/organizations.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
organizationTitles Array A list of Departments that the user belongs to, as organizationTitle types .

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "organizationTitles": [
    {
      "organization": {
        "code": "B",
        "description": "sample description",
        "id": "2",
        "localName": "sample localName",
        "localNameLocale": "en",
        "name": "Organization B",
        "parentCode": "A"
      },
      "title": {
        "code": "leader",
        "description": "leader",
        "id": "1",
        "name": "leader"
      }
    }
  ]
}