It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

confluence rest api response json to java entity Edited

String auth = Base64.getEncoder().encodeToString("admin:admin".getBytes()); CloseableHttpClient httpClient = HttpClients.createDefault();

HttpGet httpGet = new HttpGet("http://localhost:8090/rest/api/content/688131"); httpGet.addHeader("Authorization", "Basic " + auth);

CloseableHttpResponse response = httpClient.execute(httpGet);

HttpEntity entity = response.getEntity();

String strResult = EntityUtils.toString(entity);

ObjectMapper mapper = new ObjectMapper();

//JsonContentProperty content = mapper.readValue(strResult, JsonContentProperty.class);

Content content = mapper.readValue(strResult, Content.class);

Above code is not work because com.atlassian.confluence.api.model.content.Content is not match. Which entity is match? Should I have to customize the entity?

0 comments

Comment

Log in or Sign up to comment
Community showcase
Published in Confluence Cloud

What's New in Confluence Cloud – October 2019 Edition

Hey there! When you can pack so much information onto a Confluence page, it can be challenging to whittle down what’s most important. Here are a few of our favorite hacks for finding need-to-know i...

63,374 views 63 152
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you