Posting a link to a Facebook page using using php and curl - returns error
I am trying to use the Graph API to post a link (URL) to a Facebook page, using PHP and the cURL library. I am able to request a scrape with no issues. But when I try to post my URL to the page, I get the error:
(#100) Specifying multiple ids with a post method is not supported
I believe that I have the correct scopes to post to my page, per the page Access Token:
email public_profile pages_show_list pages_read_engagement pages_manage_posts
And it's the token for the page I am trying to post to. The URL that I'm pushing through cURL is (URL and MESSAGE are url-encoded):
$request_url = https://graph.facebook.com/<PAGE-ID>/?id=<URL-TO-POST>&message=MESSAGE&access_token=<PAGE-TOKEN>;
And I'm using pretty simple curl commands:
$handle = curl_init(); $curl_options = [ CURLOPT_URL => $request_url, CURLOPT_RETURNTRANSFER => true, CURLOPT_VERBOSE => false, CURLOPT_POST => true, ]; } curl_setopt_array($handle, $curl_options); $raw_data = curl_exec($handle); curl_close($handle);
But the results I get from this call:
[error] => stdClass Object ( [message] => (#100) Specifying multiple ids with a post method is not supported [type] => OAuthException [code] => 100 [fbtrace_id] => Av1ZYcuRG0hNE2KZUl94eEv )
Am I using the correct URL to post? Are there missing arguments?