Update Space Body

Updates the body of a Space.

MethodPUT
URLhttps://{subdomain}.kintone.com/k/v1/space/body.json
URL(guest space)https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/space/body.json
Authentication Password Authentication, Session Authentication
Content-Typeapplication/json

Contents

Permissions

  • Only Space Administrators can use this API.

Request Parameters

Parameter Value Required Description
id Integer or String Yes The Space ID.
body String Yes The contents of the body as an HTML string.
HTML tags that cannot be used will be automatically removed.
HTML can be used to attach Apps, files and Emoji.
The usage of the @ mark to mention a user will not notify that user.

Sample Request

JavaScript (using Kintone REST API Request)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var body = {
  'id': 1001,
  'body': '<b>Sample Space Description</b>'
};

kintone.api(kintone.api.url('/k/v1/space/body.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
var body = {
  'id': 1001,
  'body': '<b>Sample Space Description</b>',
  // CSRF TOKEN: used for all APIs that have an HTTP method of POST, PUT and DELETE on Kintone.
  '__REQUEST_TOKEN__': kintone.getRequestToken()
};

var url = 'https://{subdomain}.kintone.com/k/v1/space/body.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

  • If the Space or Guest Space feature is turned off, an error will be returned.
  • This API can only be used on Spaces with multiple threads. To update the body of a single threaded Space, use the Update Thread API.