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

Call Confluence REST from within Confluence

Stefan Ernst
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 Leaders.
May 25, 2016

Previously to 5.9 it was possible to define a TrustTokenAuthentication request and call Confluence REST through a Confluence Server plugin running on the same instance. With the deprecation of the SAL API I wanted to switch to ApplicationLinkService requests but fail to obtain the application link to Confluence itself.



ApplicationLink applicationLink = this.applicationLinkService.getPrimaryApplicationLink(ConfluenceApplicationType.class);

 

this returns null. Is there any way this can achieved?

I was hoping it would be possible to obtain a self-referencing application link

many thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Stefan Ernst
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 Leaders.
June 1, 2016

I took a completely different approach and went back to the SAL API. The newly introduced sal-trust-api brings back the TrustTokenAuthentication via

TrustedRequest request = trustedRequestFactory.createTrustedRequest(methodType, baseUrl + requestURL);

request.addTrustedTokenAuthentication(this.getDomainName(baseUrl));

hope this will help someone who stumbles upon this in the future

Prakhar Srivastav {Appfire}
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 Leaders.
October 4, 2018

@Stefan Ernst

What getDomainName() method is doing for you?

I am trying this but it is not working as it is returning 404 while the same rest call works well from browser.

 

Regards

Prakhar

Prakhar Srivastav {Appfire}
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 Leaders.
October 4, 2018

No worries.

Got it working. Thanks!!

TAGS
AUG Leaders

Atlassian Community Events