kintone API

獲取表單的設計資訊

獲取表單的設計資訊。

目錄

HTTP 方法GET
URLhttps://sample.cybozu.com/k/v1/form.json
URL(訪客空間)https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/form.json
URL(操作測試環境)https://sample.cybozu.com/k/v1/preview/form.json
URL(測試環境中的訪客空間)https://sample.cybozu.com/k/guest/GUEST_SPACE_ID/v1/preview/form.json
認證 密碼驗證 , API令牌認證 , 會話認證 , OAuth認證
Content-Typeapplication/json

請求參數

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

回應屬性

屬性名稱 類型 說明
properties 陣列 構成應用程式的欄位清單
properties[].type不同,其欄位內容也不一樣。詳情見附表。
properties[].type 字串 欄位類型
根據類型,將返回以下值:
  • SINGLE_LINE_TEXT:單行文字方塊
  • MULTI_LINE_TEXT:多行文字方塊
  • RICH_TEXT:文字編輯方塊
  • NUMBER:數值
  • CALC:計算
  • RADIO_BUTTON:選項按鈕
  • CHECK_BOX:核取方塊
  • MULTI_SELECT:複選
  • DROP_DOWN:下拉式選單
  • USER_SELECT:選擇使用者
  • ORGANIZATION_SELECT:選擇組織
  • GROUP_SELECT:選擇群組
  • DATE:日期
  • TIME:時間
  • DATETIME:日期與時間
  • FILE:附件
  • LINK:連結
  • REFERENCE_TABLE:相關記錄清單
  • SUBTABLE:表格
  • LABEL:標籤
  • SPACER:空間
  • HR:分隔線
  • RECORD_NUMBER:記錄號碼
  • CREATOR:建立人
  • CREATED_TIME:建立時間
  • MODIFIER:更新人
  • UPDATED_TIME:更新時間
如果是Lookup,將返回複製來源欄位的類型。

單行文字方塊欄位的屬性

屬性名稱 類型 說明
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 字串 是否顯示千位分隔符
  • true:顯示
  • 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 陣列(array) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼

核取方塊的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
返回「CHECK_BOX」。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 是否隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否設置為必填項
  • true:設為必填項
  • false:不設為必填項
properties[].options 陣列(array) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼

多選的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
返回「MULTI_SELECT」。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 是否隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否設置為必填項
  • true:設為必填項
  • false:不設為必填項
properties[].options 陣列(array) 項目清單
properties[].defaultValue 字串 預設值
如果未設置,則返回「null」。
properties[].code 字串 欄位代碼
屬性名稱 類型 說明
properties[].type 字串 欄位類型
返回「DROP_DOWN」。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 是否隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否設置為必填項
  • true:設為必填項
  • false:不設為必填項
properties[].options 陣列(array) 項目清單
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 字串 欄位代碼

日期的屬性

屬性名稱 類型 說明
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 字串 欄位代碼

時間的屬性

屬性名稱 類型 說明
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 字串 欄位代碼

Lookup的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
根據複製來源的欄位類型,將傳回以下值之一:
  • SINGLE_LINE_TEXT:單行文字方塊
  • NUMBER:數值
  • LINK:連結
properties[].label 字串 欄位名稱
properties[].noLabel 字串 是否隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].required 字串 是否設置為必填項
  • true:設為必填項
  • false:不設為必填項
properties[].relatedApp 數位 要連結的應用的應用程式ID
properties[].code 字串 欄位代碼

表格的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
傳回“SUBTABLE”。
properties[].label 字串 欄位名稱
properties[].noLabel 字串 是否隱藏欄位名稱
  • true:不顯示
  • false:顯示
properties[].fields 陣列 表中的欄位清單
properties[].code 字串 欄位代碼

標籤的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
返回「LABEL」。
properties[].label 字串 欄位名稱

空白欄的屬性

屬性名稱 類型 說明
properties[].type 字串 欄位類型
返回「SPACE」。
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
https\://sample.cybozu.com/k/v1/form.json?app=4
1
2
3
{
  "X-Cybozu-API-Token": "API_TOKEN"
}

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

1
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
}

  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"
    }
  ]
}

有關kintone.api()的說明,請參閱以下頁面。
傳送kintone REST 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);

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

1
2
curl -X GET 'https://sample.cybozu.com/k/v1/form.json' \
  -H 'X-Cybozu-API-Token: API_TOKEN' \

補充

限制事項

  • 以下欄位不可獲取:
    • 類別
    • 狀態
    • 群組
    • 群組內的以下欄位
      • 記錄號碼
      • 建立人
      • 建立時間
      • 更新人
      • 更新時間
      • 空白欄
      • 標籤
      • 分隔線