How can I call an external api and display its result in confluence page UI?

I am new to atlassian development. I want to call an external api via http, and display its result in confluence page UI. I want that every new page that is created in confluence of my organization has this section with a link/button to call the external api, and on click display the results on confluence UI.

Can I write a small Javascript/ client side script or macro for it? OR
do i have to create a forge application? Also how is forge application integrated in the confluence environment? Please share direction to look into.

For anyone looking to get started following steps helped me -

  1. Forge prompts you to select a template to help you start building the app. select the category UI kit and then the template confluence-content-byline. (You can select from any confluence module where you want your app to run on UI - This is where your app will be placed for some action/ click on UI.)
  2. Update the manifest to include the required permissions manifest.yml
    - key: my-test-panel
      function: main
      title: testApp
    - key: main
    - 'read:jira-work' // if you want to read from jira page 
        - '' // give permission to external app url
  id: <your-app-id>
1 Like