Open2
microCMSのAPIについて何となく調べて何となく記載する
どんな情報を持っているのか調査するためにhobbyプランで利用できるフィールドを全部使ってみて出力してみた
{
"apiFields": [
{
"idValue": "mCFrW0xQ3w",
"fieldId": "text",
"name": "text",
"kind": "text",
"required": true,
"isUnique": false
},
{
"fieldId": "textarea",
"name": "textarea",
"kind": "textArea",
"required": false
},
{
"fieldId": "richEditor",
"name": "richEditor",
"kind": "richEditor",
"required": false
},
{ "fieldId": "image", "name": "image", "kind": "media" },
{ "fieldId": "date", "name": "date", "kind": "date" },
{ "fieldId": "switch", "name": "switch", "kind": "boolean" },
{
"fieldId": "select",
"name": "select",
"kind": "select",
"selectItems": [
{ "id": "BGtGwXR30-", "value": "いち" },
{ "id": "OQ555l0YTC", "value": "に" },
{ "id": "dTQasNDivJ", "value": "さん" }
],
"multipleSelect": false
},
{ "fieldId": "number", "name": "number", "kind": "number" },
{
"fieldId": "customField",
"name": "customField",
"kind": "custom",
"customFieldCreatedAt": "2021-12-16T09:25:38.146Z"
},
{
"fieldId": "customFieldLoop",
"name": "customFieldLoop",
"kind": "repeater",
"customFieldCreatedAtList": [
"2021-12-16T09:25:38.146Z",
"2021-12-16T09:34:43.870Z",
"2021-12-16T09:35:50.952Z"
]
},
{ "fieldId": "reference", "name": "reference", "kind": "relation" },
{
"fieldId": "references",
"name": "references",
"kind": "relationList",
"required": true
}
],
"customFields": [
{
"createdAt": "2021-12-16T09:25:38.146Z",
"fieldId": "customField",
"name": "カスタムフィールド",
"fields": [
{
"idValue": "blbsq1WuK7",
"fieldId": "text",
"name": "text",
"kind": "text"
}
],
"position": [["blbsq1WuK7"]],
"updatedAt": "2021-12-16T09:25:38.146Z",
"viewerGroup": "DcN"
},
{
"createdAt": "2021-12-16T09:34:43.870Z",
"fieldId": "customField-2",
"name": "customField-2",
"fields": [
{
"idValue": "QVuh6qsvzY",
"fieldId": "text",
"name": "text",
"kind": "repeater",
"customFieldCreatedAtList": ["2021-12-16T09:25:38.146Z"]
}
],
"position": [["QVuh6qsvzY"]],
"updatedAt": "2021-12-16T09:34:43.870Z",
"viewerGroup": "DcN"
},
{
"createdAt": "2021-12-16T09:35:50.952Z",
"fieldId": "customField-3",
"name": "customField-3",
"fields": [
{
"idValue": "PCb7xrCNJK",
"fieldId": "text",
"name": "text",
"kind": "repeater",
"customFieldCreatedAtList": [
"2021-12-16T09:25:38.146Z",
"2021-12-16T09:34:43.870Z"
]
}
],
"position": [["PCb7xrCNJK"]],
"updatedAt": "2021-12-16T09:35:50.952Z",
"viewerGroup": "DcN"
}
]
}
kind
というkeyでフィールドの種類を判別しているらしい