Update Department Codes

Updates department codes of departments.

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

Contents

Permissions

Only Administrators  can use this API.

Request Parameters

Parameter Value Required Description
codes Array of Objects Yes An array of codes objects, containing data of Departments codes that will be updated.
Up to 100 codes objects can be specified.
codes[].currentCode String Yes The Department code that will be updated.
Must be 128 characters or less.
An existing Department code must be specified.
codes[].newCode String Yes The new Department code.
Must be 128 characters or less.
A Department Code that does not exist must be specified.

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
var body = {
  'codes': [
    {
      'currentCode': 'Design Department',
      'newCode': 'Global Design Department'
    },
    {
      'currentCode': 'Office of Product Workshops',
      'newCode': 'Kintone Developer Relations'
    }
  ]
};

kintone.api(kintone.api.url('/v1/organizations/codes', true), 'PUT', 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
$ curl -X PUT \
  https://{subdomain}.kintone.com/v1/organizations/codes.json \
  -H 'Content-Type: application/json' \
  -H 'X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=' \
  -d '{"codes" :
  [
    {
      "currentCode": "Design Department",
      "newCode": "Global Design Department"
    },
    {
      "currentCode": "Office of Product Workshops",
      "newCode": "Kintone Developer Relations"
    }
  ]
}'

Sample Response

1
{}