I'm new in using jira rest api.
Here is my code:
$username = 'xxxx';
$password = 'xxxx';
$url = 'http://126.96.36.199:8080/rest/api/2/Issue/DEMO-7';
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
$issue_list = (curl_exec($curl));
Why am I getting this error?:
401 - Unauthorized error while loading this page.
How to deal with this? Is there anything I need to configure in JIRA or in my Server?
If you have simpliest approach in calling rest api I will be glad to know it.
Community moderators have prevented the ability to post new answers.
It looks like you've entered wrong credencials. This code works fine, after changing "Issue" to "issue" in URL.
I've got 401 when username/password was incorrect.
The other thing may be that your user is locked and you need to solve captcha - try to login with that credentials to JIRA via web interface.
Hope that I could help,
There are a lot of holidays between November and January every year (too many to list here, see https://en.wikipedia.org/wiki/Lists_of_holidays) and for most ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events