Rest call to get macro body

Deleted user January 22, 2017

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?

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Einar Pehrson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2017

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.

Deleted user January 24, 2017

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')


Einar Pehrson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 24, 2017

@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.

TAGS
AUG Leaders

Atlassian Community Events