Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 404 and 403 using Rest API and Rest API V2

Mohammad Zaman June 14, 2023
Hello, 
I am trying to call Confluence Cloud V2 Rest API using the access token by using 3LO Authentication mechanism (code grant). 

I can generate an Access_Token and also see correct scopes.

I tried using the REST API and REST API (v2). 

I get the pageId from the Page Information
{ATLASSIAN_DOMAIN}/wiki/pages/viewinfo.action?pageId=2654211


Using Rest API V1:  (DEPRECATED)
curl --location --request GET 'https://{ATLASSIAN_DOMAIN}/wiki/rest/api/content/{id}' \

--header 'Authorization: Bearer {ACCESS_TOKEN}


RESPONSE:

{

"message": "Current user not permitted to use Confluence",

"statusCode": 403

}



Using Rest API V2: There is no API documentation for v2 for getting content by pageId.
However, I tried using the V2 GET Page By Id:

Get Page By Id V2 

curl --location --request GET 'https://{domain-name}.atlassian.net/wiki/api/v2/pages/2654211' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'Accept: application/json'
Response: 
{
"errors": [
{
"status": 404,
"code": "NOT_FOUND",
"title": "Not Found",
"detail": null
}
]
}

 
I can retrieve and see the scopes by calling 
https://api.atlassian.com/oauth/token/accessible-resources
with the Access_Token:

curl --location --request GET 'https://api.atlassian.com/oauth/token/accessible-resources' \
--header 'Authorization: Bearer {ACCESS_TOKEN}' \
--header 'Accept: application/json'


"scopes"
: [
"write:space:confluence",
"read:content-details:confluence",
"read:space-details:confluence",
"read:space.permission:confluence",
"read:space:confluence",
"read:custom-content:confluence",
"write:content.property:confluence",
"write:page:confluence",
"read:content.property:confluence",
"read:user:confluence",
"write:content:confluence",
"read:content.permission:confluence",
"read:content:confluence",
"read:attachment:confluence"
],



0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, jira product discovery learning path, product discovery training, idea prioritization, align stakeholders, discovery to delivery, product collaboration, atlassian learning, dev process, roadmap planning, insight capture, team alignment

Elevate Your Skills with Jira Product Discovery!

Unlock your potential and learn how to use Jira Product Discovery to your advantage. You’ll have the expertise to revolutionize ideas and insights, roadmapping, engage and align teams and stakeholders, and deliver the best solutions—faster. Enroll today!

Start Learning
AUG Leaders

Atlassian Community Events