url = "https://{your-domain}/wiki/api/v2/spaces" this url is mentioned in the rest api page
tried using this https://api.atlassian.com/wiki/api/v2/spaces
https://api.atlassian.com/ex/confluence/cloudid/wiki/api/v2/spaces
https://api.atlassian.com/ex/confluence/cloudid/rest/api/v2/spaces
but did not got the spaces list
You are using the wrong domain, it should be the instance URL, not api.atlassian.com. Your URL should look something like this:
https://my-instance.atlassian.net/wiki/api/v2/spaces
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.