I'm updating a page with markdown content via the the API. The update works but the page in Confluence is showing the raw markdown text instead of formatting it.
Here is the API call I'm using to update the page
curl -o output.html -0 -v -X PUT https://inhabitiq.atlassian.net/wiki/api/v2/pages/${ATLASSIAN_PAGE_ID} \
-u "${ATLASSIAN_USER}:${ATLASSIAN_API_TOKEN}" \
-H "Expect:" \
-H 'Content-Type: application/json; charset=utf-8' \
--http1.1 \
--data-binary @- << EOF
{
"id": "${ATLASSIAN_PAGE_ID}",
"status": "current",
"title": "API Documentation",
"body": {
"representation": "storage",
"value": ${NEW_CONTENT}
},
"version": {
"number": 25,
"message": "Updated API documentation"
}
}
EOF
Hello @dustin_butler
The representation format for markdown is 'wiki
' ('storage
' is HTML and 'atlas_doc_format
' is ADF)
Thanks for the reply. After looking into this some more found that $NEW_CONTENT was being converted from markdown into HTML with pandoc.
NEW_CONTENT=$(pandoc -f markdown $(pwd)/docs/docs.md | jq -Rs .);
Was throwing 500 when trying to use wiki representation but all working now.
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.