獲取kintone REST API的Schema資訊

information

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

目錄

獲取kintone REST API的Schema資訊

獲取指定kintone REST API的Schema資訊。
架構資訊不適用於以下 API:

URL

https://sample.cybozu.com/k/v1/apis/API_ID.json

路徑參數
參數名稱 說明
API 的 ID 要檢索其架構資訊的 API 的 ID
ID為 取得kintone REST API清單 的金鑰名稱。 apis
例如, 對於檢索單個記錄的 API ,鍵名稱為"record/get",URL 路徑為"."https://sample.cybozu.com/k/v1/apis/record/get.json"

HTTP 方法

GET

所需許可權

不需要憑據。

請求

參數

示例請求
URL

https://sample.cybozu.com/k/v1/apis/record/get.json

頁眉

回應

空間人員:即使您禁用了訪客空間功能,您仍然可以獲得有關這些 API 的資訊。

屬性名稱 值類型 內容
id 字串 kintone REST API的API ID
baseUrl 字串 用於執行 API 的基本 URL
path 字串 API 路徑
baseUrl path 和是 API 的 URL。
httpMethod 字串 用於執行 API 的 HTTP 方法
request 物件 API 請求的架構資訊
它以 JSON 架構表示。
response 物件 API 回應架構資訊
它以 JSON 架構表示。
schemas 物件 API 中常用的 Schema 資訊清單
屬性名稱是表示架構資訊的字串。
在 JSON 架構中用$ref引用它。
示例回應
 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
{
  "id": "records/get",
  "baseUrl": "https://sample.cybozu.com/k/v1/",
  "path": "records.json",
  "httpMethod": "GET",
  "request": {
    "type": "object",
    "required": ["app"],
    "properties": {
      "app": {
        "type": "string",
        "format": "long"
      },
      "fields": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "query": {
        "type": "string",
        "format": "query"
      },
      "totalCount": {
        "format": "boolean",
        "type": "string"
      }
    }
  },
  "response": {
    "type": "object",
    "properties": {
      "records": {
        "type": "array",
        "items": {
          "type": "object",
          "patternProperties": {
            "*": {
              "anyOf": [
                { "$ref": "CalcSimpleValue" },
                { "$ref": "CategorySimpleValue" }
                // ...
              ],
              "type": "object"
            }
          }
        }
      },
      "totalCount": {
        "format": "long",
        "type": "string"
      }
    }
  },
  "schemas": {
    "SingleLineTextSimpleValue": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["CATEGORY", "CREATED_TIME"]
        },
        "value": { "type": "string" }
      }
    },
    "MultipleLineTextSimpleValue": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["CATEGORY", "CREATED_TIME"]
        },
        "value": { "type": "string" }
      }
    }
    // 省略
  }
}

關於 JSON 架構

上述請求、回應和架構中使用的 JSON 架構基於草稿 v4。
它使用核心和驗證,而不是超架構。

類型和格式

除了JSON Schema中定義的格式外,還定義了以下格式來表示kintone的參數限制。
Kintone將來可能會添加自己的格式。

type format 說明
string long -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 範圍內的整數類型
string locale ""、"en"、"ja"或"zh"的字符串
string boolean "true"或"false"字符串
string email 電子郵件格式字串
string number 實實型
string query kintone查詢表示法
關於查詢表示法 ,請參考kintone API查詢編寫基礎
string date-time ISO 格式的日期和時間字串
string timezone 指示時區的字串

檢索檔 API 的架構

檔上傳 API

JSON模式請求物件包含kintone內部類型資訊。
實際請求應以 multipart/form-data 格式發送。

檔下載 API

JSON 架構回應物件返回空。
實際請求下載檔。

示例代碼

使用 curl 的請求
1
curl -X GET 'https://sample.cybozu.com/k/v1/apis/record/get.json
發送kintone REST API請求 使用API 發送請求
1
await kintone.api(kintone.api.url('/k/v1/apis/record/get.json'), 'GET', {});