I am creating a keyword directory-like feature in my Confluence cloud app and I would like to create a custom content `keyword` to be rendered as part of the space custom content list view. How can I do this in Forge? I have already written the following code to create the custom content but I am not sure how to proceed...:
`
export const createKeyWordCustomContent = async (type, spaceKey, pageId, keywordValue) => {
const spaceId = await getSpaceIdByKey(spaceKey);
var bodyData = `{
"type": ${type},
"spaceId": ${spaceId},
"pageId": ${pageId},
"title": "Keyword",
"body": {
"representation": "storage",
"value": ${keywordValue}
}
}`;
const response = await api.asUser().requestConfluence(route`/wiki/api/v2/custom-content`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
// postcondition: keyword custom content type created
// update the keyword value
}`
Any leads would be great. Thank you :)