HOW TO POST MESSAGE THORUGH API Edited

I want to send the message to any chatbox through hipchat api .

i am using the google postamn extension to check the status of api .

I am getting the ok status with this code but the message is not receiving chatroom

I am trying this code .

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.hipchat.com/docs/apiv2/auth/v2/room/%7B4055351%7D/HELO",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "auth_token=<AUTH TOKEN REMOVED BY ATLASSIAN>",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer <pjDT4CmgrGlBcnbRTkg6z3FJST3eb9DLcGK6eMwu>",
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded",
"postman-token: 07075af3-2ba5-09fb-fa41-f23bf69b483a"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

 

 

Note: Atlassian has edited this submission to remove the auth_token, which should be confidential.  -pb

1 comment

Edwin Ho Atlassian Team Aug 10, 2017

Hi Madeline.

You almost got it right - the correct "CURLOPT_URL" would be:

CURLOPT_URL => "https://api.hipchat.com/v2/room/4055351/notification",

Details about sending notification can be find in the following link:

Let us know how it goes!

Thanks.
Edwin

Comment

Log in or Sign up to comment
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 19, 2018 in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

16,795 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you