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

CORS error with React API Requests

Hello, I'm trying to make a request using the JIRA API. I included the needed username and password, but I'm getting a CORS error.

I've tried both axios and fetch.

 

What do I need to make a request in React? Any example?

 

Example:

```

const res = await axios.post( "https://team.atlassian.net//rest/api/3/project/Test", {},

{

auth:

{

username,

password,

},

}

);

```

1 answer

0 votes
Hana Kučerová Community Leader Dec 12, 2020

Hi @Cecil Carter ,

welcome to the Atlassian Community!

Please see the documenation for the Jira cloud REST API. Basic auth could be used, but you should use API token instead of password, see here.

I would also recommend you to start with some simplier requests like GET project or issue. POST requests usually expects some additional data provided in your request.

There are also examples visible in the documentation. Not for the React, but still I believe it could help you.

I've also noticed your URL is not correct (two slashes), please use https://team.atlassian.net/rest/api/3/project/Test

Would you please provide us the exact error mesage you get?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

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