Forums

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

Cors error React axios request

Ilja Dikteriov
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!
March 14, 2023 edited

Im just trying to do a simple request to confluence cloud but getting an CORS error

My request: 

axios.get('https://<company>.atlassian.net/wiki/rest/api/content', {
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Headers': 'Content-Type,Authorization',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, PUT, PATCH, GET, DELETE, OPTIONS',
'Access-Control-Allow-Credentials': true,
'X-Atlassian-Token': 'nocheck',
},
auth: {
username: <user>,
password: <pass>
}
});
My error:
image.png
Also I was trying to find Confluence Allow List, but it seems deprecated or I just missing something.

1 answer

1 accepted

1 vote
Answer accepted
Brant Schroeder
Community Champion
June 28, 2023

@Ilja Dikteriov Welcome to the Atlassian community

Please follow the documentation here to properly construct your rest api call https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-wiki-rest-api-content-get 

Brant Schroeder
Community Champion
June 3, 2024

@Ilja Dikteriov can you accept this answer to help others?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events