Error 400 Bad request : invalid_parameter
Can someone tell me why I keep getting the following error :
Array ( [type] => error [status] => 400 [code] => bad_request [context_info] => Array ( [errors] => Array ( [0] => Array ( [reason] => invalid_parameter [name] => entity-body [message] => Invalid value 'name=MyNewFolder&parent%5Bid%5D=0'. Entity body should be a correctly nested resource attribute name/value pair ) ) ) [help_url] => http://developers.box.com/docs/#errors [message] => Bad Request [request_id] => ***number removed for privacy***59ea0034d0d42 )
$newfolderurl="https://api.box.com/2.0/folders"; $dataVC = array( 'name' => 'MyNewFolder', 'parent' => array( 'id' => '0', ) ); $headers=array( "Authorization: $oauth" ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $newfolderurl, CURLOPT_HTTPHEADER => $headers, CURLOPT_POST => TRUE, //CURLOPT_HTTPGET => TRUE, CURLOPT_POSTFIELDS => http_build_query( $dataVC ), CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE )); $response = curl_exec($curl); $json_response = json_decode( $response, TRUE ); curl_close($curl);
Please sign in to leave a comment.
Comments
0 comments