Using the create clip API

You need pass the broadcaster_id parameter as part of the URL. I don’t see it being passed in your CURLOPT_URL line.