獲取表單的設計資訊

information

本頁面使用機器翻譯而成。
機器翻譯免責聲明 (External link)

目錄

information

若要更新表單的設計資訊或獲取表單的佈局和欄位清單,請使用以下 API:

還有一個 JavaScript 庫,可以輕鬆獲取應用的表單資訊。
kintone-config-helper

獲取表單的設計資訊

檢索窗體的設計資訊。

URL

用於檢索生產環境設置的 URL 與用於檢索測試環境設置的 URL 不同。

如果要獲取生產環境的設置
常規應用
https://sample.cybozu.com/k/v1/form.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/form.json
獲取操作測試環境的設置
常規應用
https://sample.cybozu.com/k/v1/preview/form.json
建立訪客空間
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/preview/form.json

HTTP 方法

GET

所需許可權

您必須具有以下權限之一:

  • 查看應用程式中記錄的許可權
  • 在應用程式中添加記錄的許可權

請求

參數
參數名稱 必須 說明
app 數位或字串 必須 應用的ID
範例請求(如果在網址中包含參數 )
URL

https://sample.cybozu.com/k/v1/form.json?app=4

頁眉
1
2
3
{
  "X-Cybozu-API-Token": "API_TOKEN"
}

關於請求頭,請參見 kintone REST API的通用規範

範例要求(如果要在要求正文中包含參數)
URL

https://sample.cybozu.com/k/v1/form.json

頁眉
1
2
3
{
  "X-Cybozu-API-Token": "API_TOKEN"
}

關於請求頭,請參見 kintone REST API的通用規範

身體
1
2
3
{
  "app": 4
}

回應

財產
屬性名稱 說明
properties 陣列 構成應用的欄位清單
properties[].type 每個都有不同的欄位內容。詳情見附表。
properties[].type 字串 欄位類型
根據類型,將返回以下值:
  • SINGILE_LINE_TEXT:單行文字方塊
  • MULTI_LINE_TEXT:多行文字方塊
  • RICH_TEXT:文字編輯方塊
  • NUMBER:數值
  • CALC:計算
  • RADIO_BOX:選項按鈕
  • CHECK_BOX:核取方塊
  • MULTI_SELECT:複選
  • DROP_DOWN:下拉式選單
  • USER_SELECT:選擇使用者
  • ORGANIZATION_SELECT:選擇組織
  • GROUP_SELECT:選擇群組
  • DATE:日期
  • TIME:時間
  • DATETIME:日期與時間
  • FILE:附件
  • LINK:連結
  • REFERENCE_TABLE:相關記錄清單
  • TABLE:表格
  • LABEL:標籤
  • SPACER:空間
  • HR:分隔線
  • RECORD_NUMBER:記錄號碼
  • CREATOR:建立人
  • CREATE_TIME:建立時間
  • UPDATER:更新人
  • UPDATED_TIME:更新時間
對於查找,將返回源欄位的類型。
字串(單行)欄位屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"SINGLE_LINE_TEXT"。
properties[].label 字串 欄位名稱
properties[].expression 字串 通過自動計算設置的公式
properties[].hideExpression 字串 是否顯示計算公式
  • true:不顯示
  • false:顯示
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].unique 字串 是否允許重複值
  • true:允許重複
  • false:不允許重複
properties[].minLength 字串 字元數(最小值)
返回一個整數。
如果未設置,則返回「null」。
properties[].maxLength 字串 字元數(最大值)
返回一個整數。
如果未設置,則返回「null」。
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
字串(多行)屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"MULTI_LINE_TEXT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
豐富的編輯器屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"RICH_TEXT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
數值屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"NUMBER"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].digit 字串 是否顯示千位分隔符
  • false:顯示
  • false:不顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].unique 字串 是否允許重複值
  • true:允許重複
  • false:不允許重複
properties[].minValue 字串 價值限制(最小值)
返回一個整數。
如果未設置,則返回「null」。
properties[].maxValue 字串 值限制(最大值)
返回一個整數。
如果未設置,則返回「null」。
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].displayScale 字串 小數點後的顯示位數
返回一個整數。
如果未設置,則返回「null」。
properties[].unit 字串 單位符號
如果未設置,則返回「null」。
properties[].unitPosition 字串 單位符號的位置
傳回以下值:
  • BEFORE:前置綴
  • AFTER:後置
properties[].code 字串 欄位代碼
計算屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"CALC"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
返回"false"。
properties[].expression 字串 通過自動計算設置的公式
properties[].hideExpression 字串 是否顯示計算公式
  • true:不顯示
  • false:顯示
properties[].format 字串 格式
傳回以下值之一:
  • NUMBER: 數值
  • NUMBER_DIGIT: 數值(以數位分隔)
  • DATETIME: 日期與時間
  • DATE: 日期
  • TIME: 時間
  • HOUR_MINUTE: 時間量(小時和分鐘)
  • DAY_HOUR_MINUTE: 時間量(日期和時間)
properties[].displayScale 字串 小數點後的顯示位數
返回一個整數。
如果未設置,則返回「null」。
properties[].unit 字串 單位符號
如果未設置,則返回「null」。
properties[].unitPosition 字串 單位符號的位置
傳回以下值:
  • BEFORE:前置綴
  • AFTER:後置
properties[].code 字串 欄位代碼
單選按鈕屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"RADIO_BUTTON"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
返回"true"。
properties[].options 陣列(arrays) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
複選框屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"CHECK_BOX"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].options 陣列(arrays) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
多選屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"MULTI_SELECT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].options 陣列(arrays) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
下拉屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"DROP_DOWN"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].options 陣列(arrays) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
用戶選擇屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"USER_SELECT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].code 字串 欄位代碼
組織選擇屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"ORGANIZATION_SELECT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].code 字串 欄位代碼
組選擇屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"GROUP_SELECT"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].code 字串 欄位代碼
Date 屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"DATE"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].unique 字串 是否允許重複值
  • true:允許重複
  • false:不允許重複
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].defaultExpression 字串 表達式設置為初始值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
Time 屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"TIME"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].defaultExpression 字串 表達式設置為初始值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
日期和時間屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"DATETIME"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].unique 字串 是否允許重複值
  • true:允許重複
  • false:不允許重複
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].defaultExpression 字串 表達式設置為初始值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
附件屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"FILE"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].code 字串 欄位代碼
連結屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"LINK"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].unique 字串 是否允許重複值
  • true:允許重複
  • false:不允許重複
properties[].protocol 字串 連結類型
傳回以下值之一:
  • WEB:網站
  • CALL:電話號碼:
  • MAIL:電子郵件地址
properties[].minLength 字串 字元數(最小值)
返回一個整數。
如果未設置,則返回「null」。
properties[].maxLength 字串 字元數(最大值)
返回一個整數。
如果未設置,則返回「null」。
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
相關記錄清單屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"REFERENCE_TABLE"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].relatedApp 數位 要引用的應用的應用ID
properties[].code 字串 欄位代碼
查找屬性
屬性名稱 說明
properties[].type 字串 欄位類型
根據要從中複製的欄位類型,將傳回以下值之一:
  • SINGLE_LINE_TEXT:單行文字方塊
  • NUMBER:數值
  • LINK:連結
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否強制執行
  • true:設為必填項
  • false: 非強制性
properties[].relatedApp 數位 要引用的應用的應用ID
properties[].code 字串 欄位代碼
表屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"TABLE"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].relatedApp 數位 要引用的應用的應用ID
properties[].fields 陣列 表中的欄位清單
properties[].code 字串 欄位代碼
標籤屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"LABEL"。
properties[].label 字串 欄位名稱
空間屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"SPACER"。
properties[].elementId 字串 元素的ID
邊框屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"HR"。
記錄編號屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"RECORD_NUMBER"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].code 字串 欄位代碼
作者屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"CREATOR"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].code 字串 欄位代碼
創建日期和時間屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"CREATED_TIME"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].code 字串 欄位代碼
更新人員屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"MODIFIER"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].code 字串 欄位代碼
修改後的屬性
屬性名稱 說明
properties[].type 字串 欄位類型
返回"UPDATED_TIME"。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].code 字串 欄位代碼
示例回應
  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
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
{
  "properties": [
    {
      "type": "LABEL",
      "label": "標籤",
    },
    {
      "type": "SINGLE_LINE_TEXT",
      "label": "單行文字方塊",
      "noLabel": "false",
      "code": "單行文字方塊",
      "required": "false",
      "minLength": null,
      "maxLength": "64",
      "expression": "",
      "hideExpression": "false",
      "unique": "false",
      "defaultValue": ""
    },
    {
      "type": "NUMBER",
      "label": "數值",
      "noLabel": "false",
      "code": "數值",
      "required": "false",
      "minValue": null,
      "maxValue": null,
      "digit": "false",
      "unique": "false",
      "defaultValue": null,
      "displayScale": null,
      "unit": null,
      "unitPosition": "BEFORE"
    },
    {
      "type": "CALC",
      "label": "計算",
      "noLabel": "false",
      "code": "計算",
      "required": "false",
      "expression": "100",
      "format": "NUMBER",
      "displayScale": null,
      "hideExpression": "false",
      "unit": null,
      "unitPosition": "BEFORE"
    },
    {
      "type": "MULTI_LINE_TEXT",
      "label": "多行文字方塊",
      "noLabel": "false",
      "code": "多行文字方塊",
      "required": "false",
      "defaultValue": ""
    },
    {
      "type": "RICH_TEXT",
      "label": "文字編輯方塊",
      "noLabel": "false",
      "code": "文字編輯方塊",
      "required": "false",
      "defaultValue": ""
    },
    {
      "type": "CHECK_BOX",
      "label": "核取方塊",
      "noLabel": "false",
      "code": "核取方塊",
      "required": "false",
      "options": ["sample1", "sample2"],
      "defaultValue": []
    },
    {
      "type": "RADIO_BUTTON",
      "label": "選項按鈕",
      "noLabel": "false",
      "code": "選項按鈕",
      "required": "true",
      "options": ["sample1", "sample2"],
      "defaultValue": "sample1"
    },
    {
      "type": "DROP_DOWN",
      "label": "下拉式選單",
      "noLabel": "false",
      "code": "下拉式選單",
      "required": "false",
      "options": ["sample1", "sample2"],
      "defaultValue": null
    },
    {
      "type": "MULTI_SELECT",
      "label": "複選",
      "noLabel": "false",
      "code": "複選",
      "required": "false",
      "options": ["sample1", "sample2", "sample3", "sample4"],
      "defaultValue": []
    },
    {
      "type": "FILE",
      "label": "附件",
      "noLabel": "false",
      "code": "附件",
      "required": "false"
    },
    {
      "type": "DATE",
      "label": "日期",
      "noLabel": "false",
      "code": "日期",
      "required": "false",
      "unique": "false",
      "defaultValue": null,
      "defaultExpression": "NOW"
    },
    {
      "type": "TIME",
      "label": "時刻",
      "noLabel": "false",
      "code": "時刻",
      "required": "false",
      "defaultValue": null,
      "defaultExpression": "NOW"
    },
    {
      "type": "DATETIME",
      "label": "日期與時間",
      "noLabel": "false",
      "code": "日期與時間",
      "required": "false",
      "unique": "false",
      "defaultValue": null,
      "defaultExpression": "NOW"
    },
    {
      "type": "LINK",
      "label": "連結",
      "noLabel": "false",
      "code": "連結",
      "required": "false",
      "protocol": "WEB",
      "minLength": null,
      "maxLength": null,
      "unique": "false",
      "defaultValue": ""
    },
    {
      "type": "SPACER",
      "elementId": ""
    },
    {
      "type": "HR"
    },
    {
      "type": "USER_SELECT",
      "label": "選擇使用者",
      "noLabel": "false",
      "code": "選擇使用者",
      "required": "false"
    },
    {
      "type": "SINGLE_LINE_TEXT",
      "label": "Lookup",
      "noLabel": "false",
      "code": "Lookup",
      "required": "false",
      "relatedApp": "1"
    },
    {
      "type": "REFERENCE_TABLE",
      "label": "相關記錄清單",
      "noLabel": "false",
      "code": "相關記錄清單",
      "relatedApp": "1"
    },
    {
      "type": "RECORD_NUMBER",
      "label": "記錄號碼",
      "noLabel": "false",
      "code": "記錄號碼",
    },
    {
      "type": "CREATOR",
      "label": "建立人",
      "noLabel": "false",
      "code": "建立人",
    },
    {
      "type": "CREATED_TIME",
      "label": "建立時間",
      "noLabel": "false",
      "code": "建立時間",
    },
    {
      "type": "MODIFIER",
      "label": "更新人",
      "noLabel": "false",
      "code": "更新人",
    },
    {
      "type": "UPDATED_TIME",
      "label": "更新時間",
      "noLabel": "false",
      "code": "更新時間",
    },
    {
      "type": "SUBTABLE",
      "label": "表格",
      "noLabel": "false",
      "code": "Table",
      "fields": [
        {
          "type": "SINGLE_LINE_TEXT",
          "label": "單行文字方塊",
          "noLabel": "false",
          "code": "單行文字方塊",
          "required": "false",
          "minLength": null,
          "maxLength": null,
          "expression": "",
          "hideExpression": "false",
          "unique": "false",
          "defaultValue": ""
        }
      ]
    },
    {
      "type": "ORGANIZATION_SELECT",
      "label": "選擇組織",
      "noLabel": "false",
      "code": "選擇組織",
      "required": "false"
    },
    {
      "type": "GROUP_SELECT",
      "label": "選擇群組",
      "noLabel": "false",
      "code": "選擇群組",
      "required": "false"
    }
  ]
}

示例代碼

使用 curl 的請求
1
2
curl -X GET 'https://sample.cybozu.com/k/v1/form.json?app=4' \
  -H 'X-Cybozu-API-Token: API_TOKEN'
發送kintone REST API請求 使用API 發送請求
1
2
3
4
5
const body = {
  app: kintone.app.getId()
};

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

限制

  • 以下欄位不可用:
    • 類別
    • 狀態
    • 群組
    • 組欄位中的下一個字段
      • 記錄號碼
      • 建立人
      • 建立時間
      • 更新人
      • 更新時間
      • 空間
      • 標籤
      • 分隔線