i can't figure this out, but my code are working if only one google account logged in browser, but if more that one logged account the shareable link will show error 403
function anyone($id, $token)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.googleapis.com/drive/v3/files/$id/permissions?key=$token");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-type: application/json",
"Authorization: Bearer $token",
"{\"role\":\"reader\",\"type\":\"anyone\"}"
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"role\":\"reader\",\"type\":\"anyone\"}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
can anyone show me how to fix it this problem?