Forums

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

Adding label to space via Rest API

Ilyas Gazizov
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!
March 2, 2022

My version of Conflunce server is 7.15.1

Can create spaces with labels or at least add a label to a space later?

 

Couldn't find anything about adding labels while creating spaces in the documentation.

 

As for adding labels afterwards. as described here, I tried this API request, but I get 400 (Bad Request) in return.

curl --request POST \
-u 'user:password' \
--url 'https://wiki.mydomain.com/rest/api/content/12345/label' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"title": "my_label"
}'

 

I can't even figure out how to retrieve label from an existing space.

curl -D- \
-u 'username:password' \
-X GET \
-H "Content-Type: application/json" \
'https://wiki.mydomain.com/rest/api/content/12345/label'

In return I get 404 (not found) with message "No content found with id : ContentId{id=12345}","reason":"Not Found". I doubled and tripled checked, the id of the space is correct.

1 answer

1 accepted

0 votes
Answer accepted
Sebastian Krzewiński
Community Champion
March 2, 2022

HI @Ilyas Gazizov 

 

Based on https://jira.atlassian.com/browse/CONFSERVER-54743 I think it is impossible right now. I checked it on my instance (7.13.2) and I don't see this information when I get information about space through rest api.

 

Regards,

Seba

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events