Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to create a space-level custom content type in Confluence space?

Asmaa Hadir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 18, 2023

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 :)
 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events