kintone API

獲取JavaScript/CSS自訂設定

獲取應用的 JavaScript/CSS 自訂設定。

目錄

HTTP 方法取得
URLhttps://sample.cybozu.com/k/v1/app/customize.json
URL(訪客空間)https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/app/customize.json
URL(操作測試環境)https://sample.cybozu.com/k/v1/preview/app/customize.json
URL(測試環境中的訪客空間)https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/preview/app/customize.json
認證 密碼驗證 , 會話認證 , OAuth認證
Content-Typeapplication/json(透過查詢字串指定查詢時不需指定此項)

請求參數

參數名稱 類型 必須 說明
app 數值或字串 必須 應用程式ID

回應屬性

屬性名稱 類型 說明
scope 字串 自訂的套用範圍
  • ALL:所有使用者
  • ADMIN:僅限應用管理員
  • NONE:停用
desktop 物件 有關電腦上載入的檔案的資訊
desktop.js 陣列 JavaScript檔案清單
desktop.js[].type 字串 如何指定檔
  • URL:如果在URL 中指定
  • FILE:如果通過上傳指定
desktop.js[].url 字串 檔案的 URL
desktop.js[].file 物件 附件資訊
desktop.js[].file.contentType 字串 MIME 類型
desktop.js[].file.fileKey 字串 檔鍵
desktop.js[].file.name 字串 檔案名稱
desktop.js[].file.size 字串 檔大小
單位是位元組。
desktop.css 陣列 CSS 檔案清單
desktop.css[].type 字串 如何指定檔
  • URL:如果在URL 中指定
  • FILE:如果通過上傳指定
desktop.css[].url 字串 檔案的 URL
desktop.css[].file 物件 附件資訊
desktop.css[].file.contentType 字串 MIME 類型
desktop.css[].file.fileKey 字串 檔鍵
desktop.css[].file.name 字串 檔案名稱
desktop.css[].file.size 字串 檔大小
單位是位元組。
mobile 物件 有關在行動裝置上載入的檔案的資訊
mobile.js 陣列 JavaScript檔案清單
mobile.js[].type 字串 如何指定檔
  • URL:如果在URL 中指定
  • FILE:如果通過上傳指定
mobile.js[].url 字串 檔案的 URL
mobile.js[].file 物件 附件資訊
mobile.js[].file.contentType 字串 MIME 類型
mobile.js[].file.fileKey 字串 檔鍵
mobile.js[].file.name 字串 檔案名稱
mobile.js[].file.size 字串 檔大小
單位是位元組。
mobile.css 陣列 CSS 檔案清單
mobile.css[].type 字串 如何指定檔
  • URL:如果在URL 中指定
  • FILE:如果通過上傳指定
mobile.css[].url 字串 檔案的 URL
mobile.css[].file 物件 附件資訊
mobile.css[].file.contentType 字串 MIME 類型
mobile.css[].file.fileKey 字串 檔鍵
mobile.css[].file.name 字串 檔案名稱
mobile.css[].file.size 字串 檔大小
單位是位元組。
revision 字串 應用設置的修訂號

所需存取權限

  • 應用程式管理權限

範例

1
https\://sample.cybozu.com/k/v1/app/customize.json?app=8
1
2
3
{
  "X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU="
}

有關請求頭的詳細資訊,請參閱通用規格。
kintone REST API通用規格

1
https\://sample.cybozu.com/k/v1/app/customize.json
1
2
3
4
{
  "X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU=",
  "Content-Type": "application/json"
}

有關請求頭的詳細資訊,請參閱通用規格。
kintone REST API通用規格

1
2
3
{
  "app": "8"
}

 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
{
  "scope": "ALL",
  "desktop": {
    "js": [
      {
        "type": "URL",
        "url": "https://sample.com/example.js"
      },
      {
        "type": "FILE",
        "file": {
          "contentType": "application/javascript",
          "fileKey": "20150519023802B3EB762E870645F889B22F9D4F1F3059023",
          "name": "sample.js",
          "size": "12345"
        }
      }
    ],
    "css": []
  },
  "mobile": {
    "js": [
      {
        "type": "FILE",
        "file": {
          "contentType": "application/javascript",
          "fileKey": "20140823043800E9F53A742F7F4416B6E47234DBD6C0D4025",
          "name": "mobile.js",
          "size": "12345"
        }
      },
      {
        "type": "URL",
        "url": "https://sample.com/example-mobile.js"
      }
    ],
    "css": []
  },
  "revision": "15"
}

有關kintone.api()的說明,請參閱以下頁面。
傳送kintone REST API請求

1
2
3
4
5
const body = {
  app: kintone.app.getId()
};

await kintone.api(kintone.api.url('/k/v1/app/customize.json', true), 'GET', body);

根據您的環境,curl的格式可能會有所不同。
有關說明,請參閱以下頁面。
使用curl命令執行kintone REST API/3.執行API

1
2
3
4
5
6
curl -X GET 'https://sample.cybozu.com/k/v1/app/customize.json' \
  -H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU=' \
  -H 'Content-Type: application/json' \
  -d '{
    "app": 8
  }'

限制事項

  • 不能使用 API 權杖。