help with API - No space with key

Neil Ward July 22, 2024

help please, I'm trying to write a script to get all the text from a Space, and I can connect to the api but it doesn't recognize the key to my space?!?

this is the result of the api call : 

{'statusCode': 404, 'data': {'authorized': True, 'valid': True, 'errors': [], 'successful': True}, 'message': 'com.atlassian.confluence.api.service.exceptions.NotFoundException: No space with key : DOC22'}

am I using the wrong key? see below

Screenshot 2024-07-22 at 10.10.33 AM.png

2 answers

0 votes
Neil Ward July 24, 2024

hi Jessica, turns out I was using an outdated endpoint. 

**note to self** always double check your ai coding companions code.

Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2024

Thank you for the update, Neil!

I see! If you were using the Get space endpoint, indeed it is deprecated and could not work in your script.

The Get space by ID in the v2 REST API should work, in case this is what you were missing there.

But if you are still running into any issues with that endpoint or need any clarification feel free to let us know. :)

Cheers,
Jessica

0 votes
Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2024

Hi @Neil Ward 

From the Screenshot, the space key appears to be the correct one.

Could you share what REST API endpoint you are using so we can investigate further why it is failing?

In case you are following a documentation and have the URL link, that would be helpful as well.

Regards,
Jessica

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events