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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User Macro & AJAX



I'm trying to get data from external API(non-Atlassian software) using user-macro feature.  All the examples that I see and working are all getting API data from either Confluence or Jira.  I'm wondering if user-macro feature with ajax doesn't work with external API.  

Disclaimer:  I'm new to Confluence. 

Here is a sample:

## @param Name:title=Name|type=string|required=true|desc=Your name
<script type="javascript>
type: "GET",
contentType: "application/json",
  success: function(msg){


1 answer

0 votes
Zak Laughton Atlassian Team Jan 10, 2020

Hi Dong!

It looks like an answer in the community link you posted might have the answer you're looking for:

I suppose $ is treated as a special character used by Velocity template. So, you need to escape it.I hope the following code will work.

## @param Name:title=Name|type=string|required=true|desc=Your name


<script type="text/javascript">
type: "GET",
contentType: "application/json",
  success: function(msg){

Besides, <script type="javascript> in your code should be quoted properly.

If the updated script above doesn't work, can you describe what happens when you try to use it? It will also help to know if you see any new network calls when you load the macro.

To do this:

  1. Open the page.
  2. Open your browser's dev tools to the "Network" tab
  3. Refresh the page
  4. You will see the network tab populate with all the network calls. You can check here to see if a request was made to the desired URL.

I hope this helps!
– Zak

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

408 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you