function sendWebhookMessage()
$apiKey = "your-api-key";
$uri = "https://www.hostedhooks.com/api/v1/apps/{app_uuid}/messages";
/* Build message payload*/
'event_type' => 'user.created'
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($messagePayload));
$response = curl_exec($ch);
if ($response === false) {
'status' => curl_getinfo($ch, CURLINFO_HTTP_CODE),
'error' => "CURL Error: " . curl_error($ch),
'status' => curl_getinfo($ch, CURLINFO_HTTP_CODE),
'body' => json_decode($response, true),