这是我的代码:
$params = array();
$params['shared_link'] = array("access"=> "Open");
$params = json_encode($params);
echo $params;
$key = "[key]";
$token = "[token]";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.box.com/2.0/folders/[folder_id]/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
"Authorization: BoxAuth api_key=$key&auth_token=$token",'Content-Length: ' . strlen($params), 'X-HTTP-Method-Override: PUT'));
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
我无法创建共享链接。我从 box.net 得到这个回复:
{"type":"error","status":500,"code":"internal_server_error","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Internal Server Error","request_id":"79086734650bfaf56c7894"}
有人可以帮我吗?
谢谢!
马塞洛