Upload url request simple uploads error 400 (1005)

Hi.
I can’t find an answer for this. Can’t know required fields in the documentation and the information given by the response don’t say anything.

I know is not a authentication problem so I’ve passed that after getting some errors.

This is the curl code with php and the response.

<?php header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST'); // Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/ $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, "https://api.cloudflare.com/client/v4/accounts/account_id/stream/direct_upload"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"maxDurationSeconds\": 3600,\n \"requireSignedURLs\": true,\n \"requireSignedURLsdddd\": true,\n }"); $headers = [ 'Content-Type: application/json', 'Authorization: Bearer $bearer', 'X-Auth-Key: $auth_key', 'X-Auth-Email: [email protected]' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); $info = curl_getinfo($ch); curl_close($ch); echo $result. ' - ' .$http_status. ' - ' .json_encode($info); ?>

Response:
// The second part is an echo of curl_getinfo()

{ “result”: null, “success”: false, “errors”: [ { “code”: 10005, “message”: “Bad Request” } ], “messages”: null } 1 - 400 -
// curl_getInfo()
{“url”:“https://api.Cloudflare.com/client/v4/accounts/ca3bbfaa82775fa8cd5593bf8f33a60c/stream/direct_upload”,“content_type”:“application/json; charset=UTF-8”,“http_code”:400,“header_size”:609,“request_size”:330,“filetime”:-1,“ssl_verify_result”:20,“redirect_count”:0,“total_time”:1.15373,“namelookup_time”:0.001213,“connect_time”:0.022444,“pretransfer_time”:0.06463,“size_upload”:104,“size_download”:144,“speed_download”:124,“speed_upload”:90,“download_content_length”:-1,“upload_content_length”:104,“starttransfer_time”:0.064684,“redirect_time”:0,“redirect_url”:“”,“primary_ip”:“104.19.193.29”,“certinfo”:,“primary_port”:443,“local_ip”:“192.168.1.129”,“local_port”:56387,“http_version”:3,“protocol”:2,“ssl_verifyresult”:0,“scheme”:“HTTPS”,“appconnect_time_us”:64396,“connect_time_us”:22444,“namelookup_time_us”:1213,“pretransfer_time_us”:64630,“redirect_time_us”:0,“starttransfer_time_us”:64684,“total_time_us”:1153730}

Thanks in advance.