The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Can you embed a REST API response in Confluence wiki content?

Troy Cumbo
February 9, 2014

I'm looking for a way to quickly embed some plain text output from a REST API (TeamCity) in a Confluence wiki page. I can't use the html-include macro, as it expects html and throws an error otherwise. The lone plugin that seems relevant hasn't been updated since many Confluence releases ago. I don't want to use the plugin or the TeamCity build status widget. I just need a little data from the server to sprinkle onto the page content I already have. Is there no way to just include the raw output from a URL regardless of its response type?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Bob Swift
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 Champions.
February 10, 2014

At a minimum, you can script it - Script Plugin for Confluence. Or you could treat the data returned as csv and use the CSV macro with the url.

Troy Cumbo
February 11, 2014

I went with the CSV and it worked great Bob, thanks! All I needed was the url attribute with the macro.

one useme
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!
April 1, 2019

Could you please share the sample code Troy

Like • # people like this
Troy Cumbo
June 18, 2019

Hey sorry for the delay! Took me a while to find the code.

I went a different path after the CSV macro went paid (not that I didn't like the add-on, the functionality just wasn't important enough for the price given our seat count).

But if you have the add-on, use it like so:

{csv:url=http://teamcityserver/guestAuth/app/rest/builds/buildType:dev,status:SUCCESS,lookupLimit:1/number}{csv}

Which would return the build number of the most recent successful "dev" build.

Hope this helps.

Like • cristian.balan likes this
Gabriel Diaz
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!
January 13, 2020

Troy - which alternate route did you go with? (non-paid). Thanks in advance.

Like • # people like this
TAGS
AUG Leaders

Atlassian Community Events