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

Confluence Cloud Macro Parameters

Edited

Hi there

Im learning creating Macros for Confluence Cloud, starting with the Hello World example under the Forge section.

Im now wanting to add parameters to the macro. I already have working REST API code that updates Confluence pages, and I now want to call my macro (with parameters) from within the REST API.

So for example, I have the Hello World macro on a page, which says 'Hello World'. I now want to update to the macro to display 'Hello Lee', ideally using the markdown syntax eg {LeeMacro:param1=Hello Lee{LeeMacro}

Is this possible?

1 answer

1 accepted

0 votes
Answer accepted
Bert van Dijk _TMC_nl_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 06, 2023

Hi @Lee Parvin ,

 

All options the macro gives you using the gui, can be used using the API. If you create a page with macros using the gui, then use the rest api to view/download the page, you will see how the options are included in the macro at the page.

Hi Bert

Using the Pets Macro example, I have created the macro and added it to a Confluence Page, and it works well.   However, if I try to get the macro details using the REST API using (https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---macro-body/#api-group-content---macro-body), I keep receiving the error Status 404 No Macro found on content ID..... 

The Macro ID I use was set in the Manifest.yml ie app id, and the Page ID is taken from the page that runs the macro.

Looking at the REST Response I get from calling ?expand=body.atlas_doc_format, it apprears that the Macro ID is different.

Thanks

Lee

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events