How do we consume the content of MS Office attachments (added through macro) in a wiki page?

Subhas Acharaya - TCS February 5, 2021

In the recent version upgrade of 7.9 in confluence on-premise solution we are not able to consume the HTML content data of an attachment from a wiki page through simple GET request or by calling wiki REST API end point. The first time we are getting only the tag content as "Loading" and I believe that we need to call a separate end point for fetching the content of the attachment that has been added through Wiki macro.

Can you please suggest a guide which I can follow how to construct the second API end point for fetching the content of different attachments of office software (added through macro)?

4 answers

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

Hi @Subhas Acharaya - TCS 

I checked, here's my solution.

You have to either use an attachment URL to get the data of each attachment in the page.

From API, 

GET /rest/api/content/{id}/child/attachment

Please refer to this API doc

https://docs.atlassian.com/atlassian-confluence/REST/5.8.4/#d3e2

Thanks,
Pramodh

0 votes
Subhas Acharaya - TCS February 5, 2021

Sorry by mistake i wrote something in the answer section. I am still searching for an answer from the community.

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

And can you please give the REST API endpoint you are using

Subhas Acharaya - TCS February 5, 2021

This is a simple HTTP GET request to any confluence or wiki page which contains a office document as attachment. In the HTML reply of the GET call we are not getting the content of the office attachment document like word, spreadsheet etc.

For example the below call:

GET http://xxxx.yyy.dk:{port num}/display/OYYZ/Positivlisten HTTP/1.1
Authorization: Basic xxxxxx

 

In the wiki page http://xxxx.yyy.dk:8090/display/OSDO/Positivlisten we have a spreadsheet attached. In place of spreadsheet content we are getting a content like below:

<p><div class="converter-macro-ajax-container conf-macro output-block" data-hasbody="false" data-macro-name="viewxls"><div style="display: none;" class="converter-macro-parameters">{&quot;name&quot;:&quot;Kopi af Kunder med og uden installationsaftale_161220_jk.xlsx&quot;,&quot;type&quot;:&quot;xlsx&quot;,&quot;contextEntityId&quot;:328811111}</div><div class="aui-card"><p class="title"><strong>Loading <span class="converter-macro-file-name"> </span></strong></p><aui-spinner size="medium"> </aui-spinner></div></div></p><p><br/></p><p><br/></p>

It looks like we may need to make a separate GET HTTP GET call to fetch the content of the spreadsheet. This was not the behavior before the version upgrade of Wiki. We used to content in a sinle call of HTTP GET.

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

Check under these groups once

Atlassian Group.png

 

Under Each User check the group they are in

User Web UI.png

Thanks,
Pramodh

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

FYI,

They should not be under administrators, site-admins.

Subhas Acharaya - TCS February 5, 2021

So Pramodh,

You are suggesting that it could be an access problem that is preventing us to get the content of the attached files in HTTP GET request of a wiki page?

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

Sorry got confused with the wrong Post!

Subhas Acharaya - TCS February 5, 2021

Or you mean to say that some user who is in an administrator group will have this issue? whereas an user who is not in administrator group will get the content of attached files in the first HTTP GET call itself?

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

I will try to see what the issue and respond, sorry for posting on a different question.

Subhas Acharaya - TCS February 5, 2021

Thanks Pramodh, it will be great if you can look into my issue as it has brought a road block on our web portal delivery. Earlier we used to get the entire HTML content of a wiki page (containing the office attachments) in a single call. After version upgrade all attachments are getting replaced by a tag with content as "Loading" in the HTML file of the wiki page.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events