Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence Macro - call to external API

Julien Brachet July 16, 2018

Hi,

 

I am having a look at the confluence macro as I'd like to call response from external API and the json result to be displayed within my custom macro.

At the moment the existing API could be requested through ajax call, or jQuery call in some of our web pages. The goal is to do the same within a confluence page.

What could be the best way to do it? Can any one give me some guidance?

 

1. Pull the results via a call directly a confluence macro with jQuery code? Is that possible?

2. Or request through the Java class implementing the Macro interface directly the API and then format the result to be displayed?

3. Write a Java class implementing Macro interface that generates js/jQuery code which calls the API?

 

I'm a bit lost on how to do it the right way.

2 answers

0 votes
iamgoingtosneeze July 2, 2019

Did you ever get this working? I need to do the same thing.... 

0 votes
Julien Brachet July 18, 2018

Hi,

 

Could any one help with some sample code on how to trigger javascript / jQuery for pulling data within a custom Macro, please?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events