Update User Services

Updates the services that users can use in a Kintone environment.

MethodPUT
URLhttps://{subdomain}.kintone.com/v1/users/services.json
Authentication Password Authentication, Session Authentication
Content-Typeapplication/json

Contents

Permissions

Only Administrators (External link) can use this API.

Request Parameters

A "users" array consisting of an object formed by the below properties is to be specified in the request. Services of up to 100 users can be updated.

Parameter Value Required Description
code String Yes The User Code (log-in name).
The maximum limit is 100 characters.
Values consisting of only whitespaces or null are not allowed.
services Array Yes The Service Code.
State either kintone or an empty array.

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
27
var body = {
  'users': [
    {
      'code': 'user1',
      'services': [
        'kintone'
      ]
    },
    {
      'code': 'user2',
      'services': [
        'kintone'
      ]
    },
    {
      'code': 'user3',
      'services': []
    }
  ]
};
kintone.api(kintone.api.url('/v1/users/services.json', true), 'PUT', 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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var body = {
  'users': [
    {
      'code': 'user1',
      'services': [
        'kintone'
      ]
    },
    {
      'code': 'user2',
      'services': [
        'kintone'
      ]
    },
    {
      'code': 'user3',
      'services': []
    }
  ],
  // CSRF TOKEN: Needs to be set when using API (POST, PUT, DELETE) from kintone
  '__REQUEST_TOKEN__': kintone.getRequestToken()
};

var url = 'https://{subdomain}.kintone.com/v1/users/services.json';
var xhr = new XMLHttpRequest();
xhr.open('PUT', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send(JSON.stringify(body));

Response Parameters

An empty JSON object will be returned.

Sample Response

1
{}

Limitations

  • It is not recommended run this API while performing the following operations on the Users & System Administration page: