I'm just trying to create a space, but I can't figure out the right request. The endpoint I'm using is https://<my-company>.atlassian.net/wiki/api/v2/spaces and I'm using a POST request.
My first request had the following body:
Body = @{
key = "YTST"
name = "YuliTest"
} | ConvertTo-Jsonand that resulted in a 404. The documentation says that 404 means the user does not have permissions, but I then logged in with the user whose token I'm using and created a space through the portal, so I guess it's not a permissions issue.
Anyone have any ideas? I also tried adding a description, but that also resulted in a 404:
Body = @{
key = "YTST"
name = "YuliTest"
description = @{
value = "created by automation"
representation = "plain"
}
} | ConvertTo-Json
Can you please check this REST API page?
It seems URL seems a bit different.
Also, see this Manage API tokens for your Atlassian account.
Isn't that the v1 version of the API? I was trying to use the newer API and followed the schema described here: https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/#api-spaces-post.
Regarding the tokens I authenticate successfully when I do a get request so I believe my auth headers are okay, it's something else that doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, you use v2 and auth is done in correct way if you can do get request. (Create Space is still in experimental status in v2)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I guess my question is - is there a way to get the new API to work or should I just use the old one? I can't find any working example with the new one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The v2 creation API is for members of the RBAC Early Access Program. It only exposes role-based configuration options, and not the current granular space permission configuration body. If you're just trying to make a space programatically, and you're not in the RBAC early access program, please use the v1 API that was linked above.
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.
Hey @Matthew Martin - It is still only for sites that have one of the RBAC variants enabled for their site - today this basically means Open Beta enrolled customers only.
Eventually, more sites will be getting RBAC automatically (new tenants soon, and then all tenants a little later as we continue to improve the tooling and support for existing tenants and their conversion to roles). At that time, the v2 endpoint will be available for use to those sites as well.
Currently, the only intentional difference between v1 and v2 for space creation is permissions vs. roles - so moving to v2 should be trivial.
There's also a public endpoint available for scripting / app use that will tell you if a given tenant is in an RBAC mode or not - and let you dynamically pick the endpoint that works best for your use case.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Will Stampley - however, that leads me to my next point.
Yesterday I spent a few hours trying to use it because your public REST API documentation documents it with the only caveat being "Experimental" with no information on what experimental means.
After a few hours where the API simply responses with 404 (for which the API tells me relates to "the calling user does not have permission to create spaces"), I found this thread which suggests the underlying reason is because we clearly don't have RBAC enabled.
Could you please, please add some language to the REST documentation to document this, or even better, create an error response from the API that does the same thing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Makes total sense @Matthew Martin - We'll get an update into the spec for the RBAC only endpoints to try and make that more clear here soon.
Sorry about the lost time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matthew Martin - Took longer than I thought it would due to a problem with the doc pipeline - but all the RBAC-only APIs should be clearly marked in the docs 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.