0
如何在PHP中驗證FB Workplace Account Management API?如何在PHP中驗證FB Workplace Account Management API?
他們沒有給出太多細節的文件中,但仍然這裏是鏈接的文檔。(https://developers.facebook.com/docs/workplace/authentication/password)
這裏是我寫來獲得身份驗證,以便我能得到列表的代碼儘管我想稍後添加和刪除它們,但只能通過帳戶管理API完成,而不能通過圖形API完成。
代碼:
$username='[email protected]';
$password='P3YPFTluXc18';
//Its a trial acc username & pass. You can use to test it.
$URL='https://work-48884897.facebook.com/work/login';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$result=curl_exec ($ch);
print_r($result);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo $status_code; //get status code
curl_close ($ch);