I've been turning myself inside out trying to access the User Management API for Jira Cloud.
I'm using Google Apps Script, following instructions from here: https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/#api-users-account-id-manage-get
I have both org and site admin permissions. I am using an API Token that I generated from here.https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/
I run many scripts on the regular public rest API, with no problem. https://api.atlassian.net/rest/api/2/
I get 403 messages with this error "OAuth 2.0 is not enabled for method: GET"
Note that because I'm desperate, I have tried with both just the API token (no org ID), and with the org ID (with the org ID, I get a 404)
I have also tried Basic auth, but as we all know, that's been deprecated.
Here's my code:
function getMgmtPermTest(){
var url = "https://api.atlassian.net/users/xxx.../manage";
var orgId = "123..."
var apiToken = "123..."
var encCred = Utilities.base64Encode(orgId +":"+ apiToken);
var params = {
method:"GET",
contentType:'application/json',
headers:{Authorization:"Bearer "+ apiToken}, // 403
//headers:{Authorization:"Bearer "+ encCred}, // 404
};
var response = UrlFetchApp.fetch(url, params);
Logger.log(response.getResponseCode());
}