JIRA Cloud REST API (OAuth 2.0) Error 403 on POST Requests

Hi Charles,

apologies, I only saw the headers but not a response body above.

This should log the error from the body if there’s any:

fetch(`https://api.atlassian.com/ex/jira/${cloudid}/rest/api/3/issue`,
  {
    method: 'POST',
    headers: new Headers({
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json',
      'X-Atlassian-Token': 'no-check'
    }),
    body: JSON.stringify({test: 'test'})
  }
).then((body) => {
  return body.text();
}).then((bodyText) => {
  console.log(bodyText);
}).catch((err) => {console.log(err)});

By trying the same thing you mentioned I think I found what the problem is. Your request likely fails with a ‘XSRF check failed’ in the browser.

I’ve already talked to one of our security engineers and we quickly dived into the implementation code to confirm why this not working and what would need to be changed on our side. We’ve also already opened a engineering ticket to get this addressed. This will likely take a few weeks to get addressed, but I’ll keep you posted if I hear any updates!

Cheers,

Sascha