Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
Graph returned an error: (#200) The user hasn't authorized the application to perform this action

I am using Facebook API code to publish a post on pages. But occurred the error.
I've uploaded the code on my domain even I am getting this problem.

Graph returned an error: (#200) The user hasn't authorized the application to perform this action

FB API Code:

  <?php 
    require_once(__DIR__."/fb-sdk/src/Facebook/autoload.php");

    $fb = new Facebook\Facebook([
       'app_id' => 'MY_APP_ID',
       'app_secret' => 'MY_SECRET',
       'default_graph_version' => 'v2.2',
    ]);
    $linkData = [
       'link' => 'www.mywebsite.com',
       'message' => 'Testing API'
    ];
    $pageAccessToken ='MY_ACCESS_TOKEN';
    try {
       $response = $fb->post('/me/feed', $linkData, $pageAccessToken);
    } 
    catch(Facebook\Exceptions\FacebookResponseException $e) {
       echo 'Graph returned an error: '.$e->getMessage();
       exit;
    }
    catch(Facebook\Exceptions\FacebookSDKException $e) {
       echo 'Facebook SDK returned an error: '.$e->getMessage();
       exit;
    }
    $graphNode = $response->getGraphNode();
 ?>

You can see the advance setting of API in the image, is there anything missing in code or settings?

enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can Follow this tutorial

http://www.discussdesk.com/post-into-facebook-page-using-graph-api-with-php.htm

To post to a Page "as Page", you need to authorize the user with "publish_pages" and you need to use a Page Token. Try to add publish_pages to your permission list:

$config['facebook']['permissions'] = array(
  'email',
  'user_location',
  'user_birthday',
  'publish_actions',
  'publish_pages',
  'manage_pages',
  'public_profile',
);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!