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.