Hi all, new learner here. I recently learned React and am trying to build an app for Jira.
I managed to successfully upload my React app (built with create-react-app) to my development Jira instance. But I can’t successfully call the Jira REST API to get an issue. In my learnings, I was able to call other APIs with React, so I’m not sure if Jira requires something special.
My code:
fetch('https://blah.atlassian.com/rest/api/3/issue/AP-1', {
method: 'GET',
headers: {
'Authorization': `Basic ${Buffer.from(
'email: api key'
).toString('base64')}`,
'Accept': 'application/json'
}
}).then(response => response.json()
).then(jsonResponse => {
console.log(jsonResponse.key);
})
Does anyone know if I need to be doing something differently or authenticating somehow?