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-Json
and 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.