Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Allow REST API GET request to expand body using .wiki format instead of body.storage?

jpablobr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2022

Is it possible to get pages body content in wiki format instead of storage? Similar to the POST/PUT methods but for GET requests?  

https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/#convert-wiki-markup-to-storage-format

1 answer

0 votes
Pramodh M
Community Champion
February 20, 2022

Hi @jpablobr 

Welcome to the Community!!

I believe you can get the wiki format from the body object in API 1.png

Thanks

jpablobr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 21, 2022

Hi @Pramodh M 

Based on what I've seen that's only possible on POST request, that screenshot is from the `POST /wiki/rest/api/contentbody/convert/{to}` documentation, right?

https://developer.atlassian.com/cloud/confluence/rest/api-group-content-body/#api-wiki-rest-api-contentbody-convert-to-post

That `representation` parameter is what I would have liked to also be available in the `GET /wiki/rest/api/content` request.

https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-wiki-rest-api-content-get

But not sure if there's a different API end-point that could allow this?

Ideally, what I want is this:

1. Get page content (in wiki format) via a GET request to the API.

2. Modify content locally (in wiki format).

3. Update Confluence site by sending modified page body (in wiki format) via a POST request to the API (this I'm already able to do).


Thanks for the help!

kazi develop
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 9, 2022

@jpablobr 

You can get the content in HTML and convert it to Wiki.

 

Check out this post:

Post HTML Issue Description with JIRA REST API v3 - Jira Development / Jira Cloud - The Atlassian Developer Community

 

I did something similar in my case and it worked perfectly.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events