I'm simply trying to add a label to a new page via v2 REST api. The documentation shows no v2 API that POSTs labels. All are read-only. The v1 api doesn't say deprecated for /content/{id}/label, but here lies the problem.
v1 references pages as "content" while v2 has almost entirely dropped the use of "content." ContentID does not equal PageID. My test consisted of using the page ID to fetch the content ID and then performing the v1 api label POST against the contentID. This gave me a 403 forbidden despite having full access.
Build new page. Use its pageID to get contentID
confluence_rest_api_url + "/wiki/api/v2/pages/ + str(pageid) + "/properties"
The result is in field "id"
confluence_rest_api_url + "/wiki/rest/api/content/str(contentid)/label
The POST body has the label structure: array of objects
403 error.
Hello @Mark McCurdy
I'm simply trying to add a label to a new page via v2 REST API
The simple answer is... you can't. The v2 API endpoints are under development and many of the v1 capabilities are yet to be replicated, so you need to keep using the appropriate v1 endpoints in the interim.
Refer to this thread where the same question has previously been asked, or refer to CONFCLOUD-76866 for the corresponding feature request.
As for the reason behind the great schism between v1 referring to Content generically versus v2 referring to Pages specifically, the recording of the Updates to Confluence REST API v2 presentation from Atlas Camp last year is an excellent explanation of why it's being done.
You can find all this type of information for yourself by using Google. You should try it sometime.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.