Hi
I need to create a page in confluence with label on it with the same call. Here is my API Call.
curl --location --request POST 'http://ism218:8090/confluence/rest/api/content/' --header 'Content-Type: application/json' --header 'Authorization: Basic YXJlemFlaTpBcjkyNjczMjc5IUA=' --data-raw '{
"type":"page",
"title":"page title123321123",
"space":{
"key":"sadad"
},
"body":{"storage":{"value":"abc","representation":"storage"}},
"metadata":{
"labels":[{"name":"sre"},{"name":"kpt"}]
}
}'
There is a suggestion in StackOverflow that consider this as metadata:
"metadata": {
"labels": [
{
"prefix": "global",
"name": "label1"
},
{
"prefix": "global",
"name": "label2"
}
]
}
}'
Both of them Create the page, but none of them adds a label to it.
Could you provide some advice for me about this?
Follow-up question:
How I could phrase multiline string data as Body Storage value. For example, I want to create a page via API with this content:
<ac:structured-macro ac:macro-id="5e1cdf32-bcbe-4243-ba55-041d1ed1ee74" ac:name="panel" ac:schema-version="1">
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="8372796a-22ec-4b34-bbfb-d19464e0a12c" ac:name="info" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="ed9b94a0-af84-4f26-95b7-b567b1a036a0" ac:name="tip" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
and I should provide this at Body Storage Value of my JSON:
"body":{"storage":{"value":"here","representation":"storage"}},