i am getting this response while getting resource id:
{"code":2,"reason":"response detail error:2,errMsg:post method api body check failed!"}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.agora.io/v1/apps/".$wo['config']['agora_app_id']."/cloud_recording/acquire");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode($wo['config']['agora_customer_id'].":".$wo['config']['agora_customer_certificate']),'Content-Type: application/json;charset=utf-8'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS,'{
"cname": "'.$cname.'",
"uid": "'.$uid.'",
"clientRequest":{
}
}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$db->insert("ady_tbl", ["error" => $post_id, "where_error" => json_encode($ch)]);
$response = curl_exec($ch);
curl_close($ch);
$db->where('id','1')->update('ady_tbl',array('error' => $response,
'where_error' => $response));
$db->where('id','2')->update('ady_tbl',array('error' => base64_encode($wo['config']['agora_customer_id']),
'where_error' => base64_encode($wo['config']['agora_customer_certificate'])));
$data = json_decode($response);
$resourceId = $data->resourceId;
// $db->where('id','1')->update('ady_tbl',array('error' => $resourceId,
// 'where_error' => $data->sid));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.agora.io/v1/apps/".$wo['config']['agora_app_id']."/cloud_recording/resourceid/".$resourceId."/mode/mix/start");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode($wo['config']['agora_customer_id'].":".$wo['config']['agora_customer_certificate']),'Content-Type: application/json;charset=utf-8'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS,'{
"cname":"'.$cname.'",
"uid":"'.$uid.'",
"clientRequest":{
"recordingConfig":{
"channelType":1,
"streamTypes":2,
"audioProfile":1,
"videoStreamType":1,
"maxIdleTime":120,
"transcodingConfig":{
"width":480,
"height":480,
"fps":24,
"bitrate":800,
"maxResolutionUid":"1",
"mixedVideoLayout":1
}
},
"storageConfig":{
"vendor":'.$vendor.',
"region":'.$region.',
"bucket":"'.$bucket.'",
"accessKey":"'.$accessKey.'",
"secretKey":"'.$secretKey.'",
"fileNamePrefix": [
"upload",
"videos",
"'.date('Y').'",
"'.date('m').'"
]
}
}
} ');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response);
if (!empty($data->sid) && !empty($resourceId)) {
$db->where('id',$post_id)->update(T_POSTS,array('agora_resource_id' => $resourceId,
'agora_sid' => $data->sid));
}
return true;
on the web it's working fine.. but when I call the API from mobile (which i created) it gives this error...
what should I do? i am really annoyed by this... anyone please help me what do you think why this error is coming? help much Appreciated thanks