I am following the docs, yes. It’s in php.
$url = "https://api.twitch.tv/extensions/message/" . $jwt->getClaim(”channel_id”);
$headers = array(
"Authorization: Bearer " . (string)$jwt,
"Client-Id: " . EXT_CLIENT_ID,
"Content-Type: application/json"
);
$data = array(
"content_type" => "application/json",
"targets" => array("broadcast"),
"message" => '{"content_type":"application/json", "message":"{\"foo\":\"bar\"}", "targets":["broadcast"]}'
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
Posted from my phone so bear with me.
Will try with casting the channel_id to string when I am home.
Also, my extension is in testing mode, if that matters.