I am using below code:
$data = array(
"color" => "gray",
"message_format" => "text",
"message" => "My First Notify"
$str_data = json_encode($data);
function sendPostData($url, $post)
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($post)));
$result = curl_exec($ch);
$res = sendPostData($url_send, $str_data);
if($res != false)
echo "Response: ".$res;
If anybody know how to solve let me know. Thanks in advance.
It looks like you need the Authorization header with your token: https://developer.atlassian.com/hipchat/guide/hipchat-rest-api
If that doesn't help, the response data would probably be helpful in diagnosing issues. The error codes can often tell you a lot about why any given request failed: https://developer.atlassian.com/hipchat/guide/hipchat-rest-api/api-response-codes
All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us. As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...
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