$ch = curl_init();
$data = array(
"cc" => "COUNTRY_CODE",
"phone_number" => "PHONE_NUMBER_WITHOUT_COUNTRY_CODE",
"method" => "sms", // or "voice"
"cert" => "VERIFIED_NAME_CERT_IN_BASE64",
"pin" => "EXISTING_6_DIGIT_PIN" // required if two-step verification is enabled
);
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/v1/account");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
Exact same thing. Code above results in:
{"error":{"message":"Unknown path components: \/account","type":"OAuthException","code":2500,"fbtrace_id":"APrxxxxxxxxxxxxxlxux"}}