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 Join to comment
Community showcase
Monique van den Berg
Published Thursday in Feedback & Announcements

How to earn badges on Atlassian Community

You may have visited your profile and seen a tab called badges. (If not, click on your avatar and View profile > Badges will get you there.)  But what do the happy little circles mean,...

150 views 4 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot