Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7539411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:22:28+00:00 2026-05-30T07:22:28+00:00

I am trying to post to my facebook page wall using curl but i

  • 0

I am trying to post to my facebook page wall using curl but i keep getting the following error

The user hasn't authorized the application to perform this action

How do i generate the correct access token using curl? if you go to this url http://developers.facebook.com/tools/explorer/

I can then put in the following https://graph.facebook.com/337588736279406/feed and this will show my wall feed i can then change this to post and add a field for the message content if i then run this i get the following response.

    {
  "error": {
    "message": "(#200) The user hasn't authorised the application to perform this action", 
    "type": "OAuthException", 
    "code": 200
  }
}

What do i have to do to authorize me as a user??

Can someone help me on this.

    <?php

function postify($arr) {
    $fields_string = '';
    foreach ($arr as $key => $value) {
        $fields_string .= $key . '=' . $value . '&';
    }
    return rtrim($fields_string, '&');
}


$appid = 'app id';
$redirect_url = 'http://stickynote.users36.interdns.co.uk';
$app_secret = 'app secret';
$page_id = '337588736279406';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id='.$appid.'&redirect_uri='.$redirect_url.'&client_secret='.$app_secret.'&perms=publish_stream');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);

$output = explode("=", $output);

curl_close($ch);

$postdata = array(
    'message' => 'this is a test message',
);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/'.$page_id.'/feed?access_token='.$output[1].'');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, postify($postdata));
$check = curl_exec($ch);

print_r($check);        

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:22:29+00:00Added an answer on May 30, 2026 at 7:22 am

    To be able to post content you must grant publish_stream permission to your application.

    Requesting permissions can be done using OAuth Dialog.

    BTW, If you just need it for user for testing purposes you may use Explorer Tool by choosing your application, clicking Get Access Token and checking needed permissions.

    Update:
    You will not be able to post on behalf of app, only user or page with appropriate access_token (for page it will require manage_pages and access_token from accounts connection of user).
    No need to specify perms in access_token retrieval URL. Permissions should be granted before that step.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to geotarget wall posts to my fan page using the Facebook PHP
I'm using FB.ui to post to a Facebook user wall. However, I am uncertain
i am trying to post into a Facebook Page using PHP. I have created
I am trying to post an image to a Facebook album using a form
I am trying to take a photo and post it on my facebook wall.
I'm trying to post a message on a page's wall as the page itself
I'm trying to set a like for a page object on facebook using their
I'm trying to publish a photo to a page using the following: FacebookClient client
Im trying to embed a video on my facebook PAGE feed-wall with the below
I have been trying to make wall post from multiple pages but when i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.