I've tried this code (it's just a piece) but it didn't work, with local JIRA it works fine.
I think I use wrong url for jira's rest api.
What api's url should I use?
Thanx in advance.
define('JIRA_URL', 'https://"myinstance".atlassian.net');
define('USERNAME', 'myuser');
define('PASSWORD', 'mypassword');
function post_to($resource, $data) {
$jdata = json_encode($data);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_POST => 1,
CURLOPT_URL => JIRA_URL . 'rest/api/latest' . $resource,
CURLOPT_USERPWD => USERNAME . ':' . PASSWORD,
CURLOPT_POSTFIELDS => $jdata,
CURLOPT_HTTPHEADER => array('Content-type: application/json'),
CURLOPT_RETURNTRANSFER => true
));