We run a self-hosted Jira-Environment and set up OAUth Access to use the REST API.
I am able to fetch any API Call via Terminal (cURL) but fail each time i will try to fetch via Google Apps Script.
I guess that there is only one simple little detail missing, but i cant find it. :(
This is my cURL Call:
curl -D- -X GET -H "Authorization: Basic BASE64encoded_username:passwd" -H "Content-Type: application/json" "https://JIRA-DOMAIN.de/rest/api/2/issue/ISSUE-ID"
And this is how i would like to fetch it via Google Apps Script:
function getAPIFeedback() {
var header_options = {
'method':'get',
'headers':{
'Authorization':'Basic BASE64encoded_username:passwd',
'Content-Type':'application/json;charset=UTF-8'
}
};
try{
var response = UrlFetchApp.fetch('https://JIRA-DOMAIN.de/rest/api/2/issue/ISSUE-ID', header_options);
Logger.log(response);
}catch(err){Logger.log(err)}
}
Each time I get a 401 Error, and dont understand why.
I would be very happy if someone could help me.
Bet Regards, Michael
Any chance that there is a reverse proxy involved which requires additional authentication? ;-)
*hmm
Could be possible.
I will get in touch with my Admin and give it a try.
Thanks for your advice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same occurred to me.
It is fixed?
There is a workaround to solve it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.