Hi Leaders,
I’m trying the following code for creating live streaming via cURL request:
$url = "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT/stream/live_inputs";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Authorization: Bearer $TOKEN",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = '{"meta": {"name":"test stream 1"},"recording": { "mode": "automatic", "timeoutSeconds": 10, "requireSignedURLs": false, "allowedOrigins": ["*.www.stockvoyager.com"] }}';
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
curl_close($curl);
print_r($resp);
It’s give me the following response:
string(77) "{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]} "
Note: I’m trying active TOKEN and accountID
Not sure what the issue is, Please help if you can.