Skip to content

Commit b1ff633

Browse files
authored
Merge pull request #84 from microcmsio/auto-update-docs-20251006T045748
ドキュメントの更新を同期
2 parents 2c1b464 + 2bc9448 commit b1ff633

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
contentId: get-api-info
3+
directory: management-api
4+
---
5+
6+
# GET /api/v1/apis/{endpoint}
7+
8+
指定したAPIのスキーマ情報(フィールド定義やカスタムフィールドの構成)を取得できるAPIです。
9+
10+
リクエストヘッダー
11+
=========
12+
13+
X-MICROCMS-API-KEY
14+
------------------
15+
16+
マネジメントAPIのGET APIリクエストの際に必要な認証キーです。
17+
マネジメントAPIのデフォルト権限で「API情報の取得」を有効にして、リクエストヘッダーに含めて送信してください。
18+
19+
![](https://images.microcms-assets.io/assets/d6af1616730544a596d299c20834f460/d5f0d65010ff41ac943e3b6b0b13827b/CleanShot%202025-09-25%20at%2015.20.49.png)
20+
21+
X-MICROCMS-API-KEYが判別できると、第三者による不正なコンテンツの操作が可能となります。お取り扱いには十分ご注意ください。詳細は「[APIキー(APIの認証と権限管理)](https://document.microcms.io/content-api/x-microcms-api-key)」をご覧ください。
22+
23+
レスポンスボディ
24+
========
25+
26+
基本的には、[APIスキーマのエクスポート](/manual/export-and-import-api-schema#hce5de2e41a)でエクスポートしたJSONと同様のデータがレスポンスとして返却されます。
27+
こちらがマネジメントAPIで取得したAPI情報のレスポンス例です。
28+
29+
{
30+
  "apiFields": [
31+
    {
32+
      "fieldId": "title",
33+
      "name": "タイトル",
34+
      "kind": "text",
35+
      "required": false
36+
    },
37+
    {
38+
      "fieldId": "body",
39+
      "name": "本文",
40+
      "kind": "richEditorV2",
41+
      "required": false
42+
    },
43+
    {
44+
      "fieldId": "tags",
45+
      "name": "タグ",
46+
      "kind": "select",
47+
      "required": false,
48+
      "multipleSelect": true,
49+
      "selectInitialValue": [],
50+
      "selectItems": [
51+
        {
52+
          "id": "Hc1QzudmqV",
53+
          "value": "更新情報"
54+
        },
55+
        {
56+
          "id": "Fx0fDbBj7S",
57+
          "value": "チュートリアル"
58+
        },
59+
        {
60+
          "id": "_SczHMUJgH",
61+
          "value": "お知らせ"
62+
        }
63+
      ]
64+
    },
65+
    {
66+
      "fieldId": "image",
67+
      "name": "画像",
68+
      "kind": "custom",
69+
      "required": false,
70+
      "customFieldCreatedAt": "2025-09-26T06:21:39.128Z"
71+
    }
72+
{
73+
  "fieldId": "category",
74+
  "name": "カテゴリ",
75+
  "kind": "relation",
76+
  "required": false,
77+
  "referencedApiEndpoint": "categories"
78+
}
79+
  ],
80+
  "customFields": [
81+
    {
82+
      "createdAt": "2025-09-26T06:21:39.128Z",
83+
      "fieldId": "image-w-name",
84+
      "name": "名前付き画像",
85+
      "fields": [
86+
        {
87+
          "idValue": "7d5MaoOs3o",
88+
          "fieldId": "name",
89+
          "name": "名前",
90+
          "kind": "text",
91+
          "required": false
92+
        },
93+
        {
94+
          "idValue": "bFhsk2ZidD",
95+
          "fieldId": "image",
96+
          "name": "画像",
97+
          "kind": "media",
98+
          "required": false
99+
        }
100+
      ],
101+
      "position": [
102+
        [
103+
          "7d5MaoOs3o",
104+
          "bFhsk2ZidD"
105+
        ]
106+
      ],
107+
      "updatedAt": "2025-09-26T06:22:22.33Z"
108+
    }
109+
]
110+
}
111+
112+
### マネジメントAPIでのみ取得できる値
113+
114+
* マネジメントAPIでは、コンテンツ参照・複数コンテンツ参照の参照先APIのエンドポイントを`referencedApiEndpoint` として取得できます。
115+
* ただし、取得したデータをAPIインポートでインポートする場合、この値は無視されます。
116+
117+
* 管理画面のAPIエクスポートでエクスポートしたAPIスキーマのJSONとは、キーの並び順などが異なることがあります。

0 commit comments

Comments
 (0)