Forums

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

403 on POST requests with Connect Framework

Werare November 8, 2020

I am using Atlassian Connect framework with node.js.

I am trying to create a user with REST API. Most of the get endpoints work in the same file but some POST requests do not work. Example of this is "/rest/api/3/user"

This is the way I am sending request but it returns 403.

let userData = `{
"password": "abracadabra",
"emailAddress": "mia@atlassian.com",
"displayName": "Mia Krystof",
"name": ""
}`;

AP.request({
url: '/rest/api/3/user',
type: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
data: userData,
success: function(responseText){
console.log(responseText);
},
error: function(xhr, statusText, errorThrown){
console.log(arguments);
}
});

AFAIK authentication (JWT-based) is built into the Connect libraries so we don't need to anything extra. 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events