How can I post via API to a Facebook Page without having my "Facebook App" suspended/deleted?
I need to share a URLs per day, via API, from my own script to a Facebook Page I manage.
I followed these instructions to create a "Facebook app" and get the "never-expiring" token.
Once I have the token, I can easily post like this:
<?php class FacebookMessenger{ protected string $pageId = '<my-page-id>'; protected string $token = '<my-token>'; public function sendUrlToPage(string $url){ $endpoint = "https://graph.facebook.com/v19.0/{$this->pageId}/feed"; $this->lastResponse = HttpClient::create()->request('POST', $endpoint, [ "headers" => [ "Content-Type" => "application/json", ], "query" => [ "link" => $url, "access_token" => $this->token ] ]); $content = $this->lastResponse->getContent(false); var_dump($content); die(); } } (new FacebookMessenger())->sendUrlToPage('https://example.com');
This works beautiful for a few days, but then the Facebook App I created gets "restricted":
TLI Sharer App DEV is restricted due to violations
The app TLI Sharer App DEV is in violation of Meta’s Platform Terms or Developer Policies and has been restricted, as described below: Platform Term 7.e.i.2 - Negatively impacting platform, products, data, or users
We determined that your app is negatively impacting the platform, products, data, or users and has violated or may have violated our terms. This violates Platform Term 7.e.i.2.
This is the linked page: https://developers.facebook.com/terms/dfc_platform_terms/#compliancereviewrightsandsuspensionandterminationoftheseterms
I fail to see how running 5/6 API requests like this is a problem, and I have absolutely ZERO ideas on how to proceed.