Hi,
We have to delete a bunch of users from Atlassian Access. I’ve found the following API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-delete
I know that it says that it’s experimental, but I get the following error, also with non-experimental API calls from this page:
So I am using exactly this script:
// https://www.npmjs.com/package/node-fetch
const fetch = require('node-fetch');
fetch('https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10ac8d82e05b22cc7d4ef5', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${Buffer.from(
'email@example.com:<api_token>'
).toString('base64')}`
}
})
.then(response => {
console.log(
`Response: ${response.status} ${response.statusText}`
);
return response.text();
})
.then(text => console.log(text))
.catch(err => console.error(err));`Preformatted text``
By adding my domain, my e-mail address and my API key (retrieved via Atlassian Access).
But I get the following error:
Response: 401 Unauthorized
Basic authentication with passwords is deprecated. For more information, see: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html
I also tried with my API key found via id.atlassian.net.
Anyone ideas?
Thank you in advance.