Confluence space rest api works with chrome browser (logged in) but not Postman

Adlisyam Azhar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 23, 2022

Hi, 

I can get the JSON from rest api using a browser but not Postman (Basic Authentication). I did not have this problem getting issues from Jira Service management and has been given permission to this space. Does anyone know why that is? 

I was trying to access this endpoint: /wiki/rest/api/space/EUW/content?expand=history

I got this error in Postman:

{
"statusCode": 404,
"data": {
"authorized": true,
"valid": true,
"errors": [],
"successful": true
},
"message": "com.atlassian.confluence.api.service.exceptions.NotFoundException: No space found with key : EUW"
}

 

3 answers

1 vote
Rasmus Norup March 7, 2024

I have the exact same problem.
Browser works, postman/python does not.
I have tried both with bearer token and basic auth.
I am using the same confluence user account for all 3 things.

0 votes
aqa-team
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2024

@Alex Koxaras _Relational_ i have exactly the same problem as described by @Adlisyam Azhar 
To summarize:
- logged in the browser with credentials myuser/mypassword i can open page https://mywiki.atlassian.net/wiki/rest/api/content?spaceKey=Test&title=SamplePage&expand=body.storage,version
- i get http response code 200
- i send request to same url in postman, adding basic auth with myuser/mypassword
- i get "com.atlassian.confluence.api.service.exceptions.NotFoundException: No space with key : Test"

- basically tried to send same request using curl and in my node js app, which uses this library fro communication with confluence https://www.npmjs.com/package/confluence-api. and all the time i get same results, except browser.

any updates on this issue?

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2022

@Adlisyam Azhar and welcome to the community,

According to the API doc:

Returned if any of the following is true:

  • There is no space with the given key.
  • The calling user does not have permission to view the space.

A schema has not been defined for this response code.

So I would either check the space key and the viewing permission of the authentication user you are using to make this http request.

I tried it on my instance and works as expected.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events