Hi - I am trying to upload a file using php WEB API, please let me know what am I doing wrong in the below code.
$params = {"file":{"name":"\/home\/projsnap\/public_html\/artwork\/wp-content\/uploads\/2022\/02\/PSNAP-PoqAOGtSk6.jpeg","mime":"","postname":"PSNAP-PoqAOGtSk6.jpeg"},"name":"PSNAP-PoqAOGtSk6.jpeg","parent_id":"115643781052","access_token":"XaMcjFobU7b3egPcD7ndifBkT4RFbq5u"}
$params = array('file' => $file, 'name' => $name, 'parent_id' => $parent_id, 'access_token' => $this->access_token);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
$data = curl_exec($ch);
curl_close($ch);
return $data;
I am getting below error -
{"type":"error","status":404,"code":"not_found","context_info":{"errors":[{"reason":"invalid_parameter","name":"parent","message":"Invalid value 'd_115643781052'. 'parent' with value 'd_115643781052' not found"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Not Found","request_id":"4rf8g4gz65g9qhey"}