Add Departments

Adds Departments to a Kintone environment.

MethodPOST
URLhttps://{subdomain}.kintone.com/v1/organizations.json
AuthenticationPassword Authentication
Content-Typeapplication/json

Contents

Permissions

Only Administrators  can use this API.

Request Parameters

Parameter Value Required Description
organizations Array of Objects Yes An array of organizations objects, containing data of Departments to be added.
Up to 100 organizations objects can be specified.
organizations[].code String Yes The Department Code.
The Maximum limit is 128 characters.
organizations[].name String Yes The new Name of the Department.
The Maximum limit is 128 characters.
organizations[].localName String Optional The Local Name of the Department.
The Maximum limit is 128 characters.
organizations[].localNameLocale String Optional The Locale of the local name.
One of “en”, “ja” and “zh” can be specified.
organizations[].parentCode String Optional The Code of parent Department.
organizations[].description String Optional The Description of the Department.
The Maximum limit is 1000 characters.

Sample Request

JavaScript (using Kintone REST API Request )

 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
var body = {
  'organizations': [
    {
      'code': 'security',
      'name': 'Department of Internet Security',
      'localName': 'Department of Internet Security',
      'localNameLocale': 'en',
      'description': 'A Department dedicated to the Internet Security of the company.'
    },
    {
      'code': 'database_acquistion',
      'name': 'Department of Database Acquisition',
      'localName': 'Department of Database Acquisition',
      'localNameLocale': 'en',
      'description': 'A Department dedicated to acquiring the most productive databases.'
    }
  ]
};

kintone.api(kintone.api.url('/v1/organizations', true), 'POST', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

curl Sample

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ curl -X POST \
  https://{subdomain}.kintone.com/v1/organizations.json \
  -H 'Content-Type: application/json' \
  -H 'X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=' \
  -d '{"organizations":
  [
    { 
      "code": "security", 
      "name": "Department of Internet Security", 
      "localName": "Department of Internet Security", 
      "localNameLocale": "en", 
      "description": "A Department dedicated to the Internet Security of the company." 
    }, 
    { 
      "code": "database_acquistion", 
      "name": "Department of Database Acquisition", 
      "localName": "Department of Database Acquisition", 
      "localNameLocale": "en", 
      "description": "A Department dedicated to acquiring the most productive databases." 
    } 
  ]
}'

Sample Response

1
{}

Limitations

  • The Parent Department stated within the parentCode parameter may also exist inside request parameter array. In this case, the array must include the data of the Parent Department before the Child Department.