Hello everyone,
I'm new to Jira REST API so I have a Jira running on localhost, just to get used to it. Right now I'm just tryring to authenticate. The problem ist, that I get a 403. This is my code:
$username = 'username';
$password = 'api token';
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,'http://localhost:8080/rest/api/2/user?username=username');
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$query = curl_exec($curl_handle);
curl_close($curl_handle);
echo $query;