Not able to import the spaces in confluence through rest api

Mounika S
Contributor
June 24, 2024

We are able to back up space through rest API, but we are not able to restore those space through the REST API.

And Used this url(Hostname/rest/api/backup-restore-restore/space/upload) in postman but getting 401 unauthorised error 

And we uploaded a XML zipfile in fromdata 

1 answer

0 votes
Hugo Navia
Contributor
June 24, 2024

Hi Mounika,

I don't think that the appropriate API.

Check this page:

Kind regards,

Hugo.

Senior Consultant | ServiceRocket

Mounika S
Contributor
June 24, 2024

Thank you for responding nugo 

 

We tried all the url in above url sheet for import but still we getting 401 unauthorised error

 

Thanks & regards

Mounika 

 

Hugo Navia
Contributor
June 25, 2024

Hi Mounika,

The 401 means that there's an error on the login. Are you trying to run the script using the basic auth or a token?

Also, which user are you using to import the space? Please note that there might be 2 types of errors:

  • AUTHENTICATED_FAILED
    • The credentials are wrong, either the user name or the password.
  • AUTHENTICATION_DENIED
    • Too many failed authentication attempts in a row, a CAPTCHA challenge is triggered, and this error will occur until the Failed Login Count is reset.
    • This is quite easy to happen if you're testing a script. All you need to do is to reset the failed attempts directly in Confluence or, login into Confluence with the user and resolving the CAPTCHA.

The 401 is not a bad sign anyway as it confirms you're reaching the system.

I would suggest to run a test using your basic auth credentials.

 

Let me know how it goes.

 

Kind regards,

Hugo.

Mounika S
Contributor
July 5, 2024

Hi Hugo,

I created spaces in the source, exported them, downloaded the ZIP file, and imported it into the target. However, I am getting a 400 Bad Request error?

Thanks

Mounika.

 

Hugo Navia
Contributor
July 5, 2024

There's no direct way of doing this through API but I found a document that might help you out:

https://confluence.atlassian.com/confkb/confluence-space-import-via-scripting-tools-1041075950.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events