Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Any confluence REST call returns 404 Edited

I am trying to get a confluence page, and my final goal is to modify it, but I seem to get a 404 return regardless of what I call. I am using the Jira REST quite a lot, which works fine, but for confluence I have no idea what is wrong.

I have admin privileges to the entire chain of pages and my python code is as follows:

auth = (<myUser>, <myPassword>)
headers = {'Content-Type' : 'application/json'}
url = "https://<myDomain>/confluence/rest/api/content/295789998?expand=body.storage"

response = requests.get(url, auth=auth, headers=headers)
print(response)

which prints:
<Response [404]>

In pure desperation I tried regular curl calls as well, of course with the same result.

I have tried virtually all type of calls found at:
https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/

and they all return 404 (page not found)

 

All help is much appreciated!

 

EDIT:

 

I also tried with an api token as below, and got a 401 error (unauthorized):

import requests
from requests.auth import HTTPBasicAuth
import json

url = "https://<myDomain>/confluence/rest/api/content/295789998?expand=body.storage"
token = "<myAPIToken>"
auth = HTTPBasicAuth(user, token)

headers = {
"Accept": "application/json"
}

response = requests.request(
"GET",
url,
headers=headers,
auth=auth
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

 What am I doing wrong?

4 answers

0 votes
Diego Atlassian Team Jan 28, 2019

Hello there!

Could you clarify one specific thing for us:

- What happens if you try this, directly on the browser that you use to access Confluence:

https://yourdomain.com/confluence/rest/api/content/295789998?expand=body.storage

 Is there any kind of return from the server?

facing same issue, and above link is also giving same error.

below link is working:-

https://mydomain/rest/api/2/issue/createmeta

Hello,

 

I am also facing a 404 whenever i try to request a rest api call in my local confluence server.

I tried the request in postman as well still ended up in the same 404 page. 

I am using this URL: http://localhost:8080/confluence/rest/api/content . My Server is up and running when i try hit this URL in the browser i can see that page not found (404)

Could anyone let me know why is this?

 

Thanks

Darshan

 i also run into this problem. cloud someone give me a solution?

using python jira package and python requests package all will  happend 

I know this is monumentally late, but I'm using Confluence Server (installed via https://hub.docker.com/r/atlassian/confluence-server/ docker - tag 7.5.0-rc1-ubuntu) and I ran into this same problem earlier.

My nodejs app was hitting

http://localhost:8090/confluence/rest/api/space

Turns out the /confluence at the start is part of the context path, Confluence was expecting me to hit

http://localhost:8090/rest/api/space

 When I passed the Authorization header with base64 username, password, correct user permissions etc. it all worked!!! I haven't tested other REST API endpoints, but I'm sure it's the /confluence in my installation that makes it do that.

Hope I helped someone :)
Thanks, Seb

Additionally, when I typed

http://localhost:8090/rest/api/accessmode

into my browser, I saw

"READ_WRITE"

in the window.

Probably test this first to see if the path /rest/api is correct for you.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

408 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you