I'm working on a requirement to get macro content body from server side code. I'm using the rest api "/rest/api/content/<page-id>/history/<page-version>/macro/id/<macro-id>" for the same. We are using Atlassian Spring Boot connect framework in our project. How can we pass authentication details in the rest calls?
Community moderators have prevented the ability to post new answers.
Hi @Ravi Teja Chennupati,
as described in the README, you can call AtlassianHostRestClients#authenticatedAsAddon()
to obtain a Spring RestTemplate
HTTP client that will automatically provide JWT authentication for requests from your add-on to an installed host product.
Thank you @Einar Pehrson. I'm facing challenge in importing AtlassianHostRestClients. Below are the dependencies specified in my build.gradle file. I don't see any documentation around the same. Any pointers would be appreciated.
Dependencies:
compile('com.atlassian.connect:atlassian-connect-spring-boot-starter:1.2.1')
compile('com.atlassian.connect:atlassian-connect-spring-boot-jpa-starter:1.2.1')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Teja Chennupati, those are the right dependencies.
I created a small Gradle sample the other day (see atlassian-connect-spring-boot-sample-gradle
), and I have no trouble accessing AtlassianHostRestClients
there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.