Update Customization

Updates the JavaScript and CSS Customization settings of an App.

This API updates the pre-live settings.
After using this API, use the Deploy App Settings API to deploy the settings to the live App.

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

Contents

Permissions

  • Only Kintone Administrators can use this API.
  • App Management Permissions are needed.
  • API Tokens cannot be used with this API.

Request Parameters

Parameters that are ignored will not be updated.

Parameter Value Required Description
app Integer or String Yes The App ID.
desktop Object An object containing data of JavaScript and CSS files for the desktop.
desktop.css Array An array listing data of CSS files for desktop.
desktop.css[].file Object An Object containing data of CSS file uploads.
Specify, if "FILE" is selected for desktop.css[].type . Along with desktop.css[].url, up to 30 may be specified.
desktop.css[].file.fileKey String The fileKey of the CSS file.
To attach a file, specify the fileKey that is responded when using the Upload File API.
To keep the current CSS files that are attached to the App, specify the fileKeys that are responded when using the Get Customization API for the Pre-live settings.
desktop.css[].type String The end-point type of the CSS file:
  • URL: the CSS file is specified with a URL.
  • FILE: the CSS file is uploaded to the App.
desktop.css[].url String The URL of the CSS file.
Specify, if "URL" is selected for desktop.css[].type . Along with desktop.css[].file, up to 30 may be specified.
desktop.js Array An array listing data of JavaScript files.
desktop.js[].file Object An Object containing data of an uploaded JavaScript file.
Specify, if "FILE" is selected for desktop.js[].type . Along with desktop.js[].url, up to 30 may be specified.
desktop.js[].file.fileKey String The fileKey of the JavaScript file.
To attach a file, specify the fileKey that is responded when using the Upload File API.
To keep the current JavaScript files that are attached to the App, specify the fileKeys that are responded when using the Get Customization API for the Pre-live settings.
desktop.js[].type String The end-point type of the JavaScript file:
  • URL: the JavaScript file is specified with a URL.
  • FILE: the JavaScript file is uploaded to the App.
desktop.js[].url String The URL of the JavaScript file.
Specify, if "URL" is selected for desktop.js[].type . Along with desktop.js[].file, up to 30 may be specified.
mobile Object An object containing data of JavaScript and CSS files for the mobile.
mobile.css Array An array listing data of CSS files for mobile.
mobile.css[].file Object An Object containing data of CSS file uploads.
Specify, if "FILE" is selected for mobile.css[].type . Along with mobile.css[].url, up to 30 may be specified.
mobile.css[].file.fileKey String The fileKey of the CSS file.
To attach a file, specify the fileKey that is responded when using the Upload File API.
To keep the current CSS files that are attached to the App, specify the fileKeys that are responded when using the Get Customization API for the Pre-live settings.
mobile.css[].type String The end-point type of the CSS file:
  • URL: the CSS file is specified with a URL.
  • FILE: the CSS file is uploaded to the App.
mobile.css[].url String The URL of the CSS file.
Specify, if "URL" is selected for mobile.css[].type . Along with mobile.css[].file, up to 30 may be specified.
mobile.js Array An array listing data of JavaScript files.
mobile.js[].file Object An Object containing data of JavaScript file uploads.
Specify, if "FILE" is selected for mobile.js[].type . Along with mobile.js[].url, up to 30 may be specified.
mobile.js[].file.fileKey String The fileKey of the JavaScript file.
To attach a file, specify the fileKey that is responded when using the Upload File API.
To keep the current JavaScript files that are attached to the App, specify the fileKeys that are responded when using the Get Customization API for the Pre-live settings.
mobile.js[].type String The end-point type of the JavaScript file:
  • URL: the JavaScript file is specified with a URL.
  • FILE: the JavaScript file is uploaded to the App.
mobile.js[].url String The URL of the JavaScript file.
Specify, if "URL" is selected for mobile.js[].type . Along with mobile.js[].file, up to 30 may be specified.
revision Integer or String Specify the revision number of the settings that will be deployed.
The request will fail if the revision number is not the latest revision.
The revision will not be checked if this parameter is ignored, or -1 is specified.
scope String The scope of customization
  • ALL: Affect all users
  • ADMIN: Affect only App administrators
  • NONE: Disable

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var body = {
  'app': 1,
  'scope': 'ALL',
  'desktop': {
    'js': [
      {
        'type': 'URL',
        'url': 'https://www.example.com/example.js'
      },
      {
        'type': 'FILE',
        'file': {
          'fileKey': 'ddfc8e89-7aa3-4350-b9ab-3a75c9cf46b3'
        }
      }
    ],
    'css': []
  },
  'mobile': {
    'js': [
      {
        'type': 'FILE',
        'file': {
          'fileKey': '20150519023802B3EB762E870645F889B22F9D4F1F3059023'
        }
      },
      {
        'type': 'URL',
        'url': 'https://www.example.com/example-mobile.js'
      }
    ],
    'css': []
  }
};

kintone.api(kintone.api.url('/k/v1/preview/app/customize.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var body = {
  'app': 1,
  'scope': 'ALL',
  'desktop': {
    'js': [
      {
        'type': 'URL',
        'url': 'https://www.example.com/example.js'
      },
      {
        'type': 'FILE',
        'file': {
          'fileKey': 'ddfc8e89-7aa3-4350-b9ab-3a75c9cf46b3'
        }
      }
    ],
    'css': []
  },
  'mobile': {
    'js': [
      {
        'type': 'FILE',
        'file': {
          'fileKey': '20150519023802B3EB762E870645F889B22F9D4F1F3059023'
        }
      },
      {
        'type': 'URL',
        'url': 'https://www.example.com/example-mobile.js'
      }
    ],
    'css': []
  },
  // 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/preview/app/customize.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

Parameter Type Description
revision String The revision number of the App settings.

Sample Response

1
2
3
{
  "revision": "3"
}