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 6128211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:36:05+00:00 2026-05-23T16:36:05+00:00

I’m trying to use the Facebook C# SDK to publish posts to the wall

  • 0

I’m trying to use the Facebook C# SDK to publish posts to the wall of a company page.
I need to do this from a batch job, so this is not a web app that any particular user is interacting with.
I have a Facebook application set up under my own Facebook ID, and I have granted it publish_stream, share_item, offline_access, and manage_pages permissions under my account. (I can verify that these permissions have been granted to the app under my Facebook settings page.) And the company page that I’m trying to post to is a page that I created myself, so I should have full access to it.

I am authenticating to Facebook with the app ID and secret for this application, getting an access token, putting together a message to post, then trying to post it. I get the following exception:

Facebook.FacebookOAuthException was unhandled by user code
Message=(OAuthException) (#200) The user hasn't authorized the application to perform this action

I’ve tried a few variations on the theme, but I can’t seem to figure out what I’m doing wrong.
Here’s a bit of my code:

        var client = new FacebookClient("APP ID", "SECRET");
        _log.DebugFormat("access token={0}", client.AccessToken);
        dynamic parameters = new ExpandoObject();
        parameters.message = "testing 123";
        /* fill in other parameters */
        dynamic result = client.Post(FanPageId+"/feed", parameters);
        /* here's where I get the exception */

I have seen references to pulling a page-specific access token out of the data returned from /me/accounts, but I can’t figure out how to do that from an offline app that’s authenticating as a Facebook app, rather than as a Facebook user.

UPDATE: I’ve gotten part of the way there by using this bit of code to connect to Facebook:

        var client = new FacebookClient("NON-EXPIRING OAUTH TOKEN");

…where the “non-expiring oauth token” is the one shown in the developer app on Facebook for the app in question.

This is still posting under my own ID though, so now I need to go the extra step of figuring out how to get the post to appear to come from the page itself.

  • 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-23T16:36:05+00:00Added an answer on May 23, 2026 at 4:36 pm

    I’ve figured this out now, so I’m going to answer my own question. This method allowed me to post to a fan page, under the ‘name’ of the fan page, without user intervention, using only Facebook.dll (not requiring Facebook.Web.dll).

    // init with a non-expiring access token for an app that can manage the fan page
    var client = new FacebookClient(fbAppOaToken);
    
    // get accounts, using a Facebook ID for a user who has admin rights to the fan pge
    dynamic accts = client.Get(string.Format("/{0}/accounts", fbAppAdminUser));
    
    // find the access token for the fan page
    string page_access_token = null;
    foreach (var acct in accts.data)
    {
        if (acct.id == fbFanPageId)
        {
            page_access_token = acct.access_token;
            break;
        }
    }
    
    // fill in parameters for the message to post
    dynamic parameters = new ExpandoObject();
    parameters.message = "testing 123";
    
    // and include the access token as retrieved above
    parameters.access_token = page_access_token;
    
    dynamic result = client.Post(fbFanPageId + "/feed", parameters);
    

    If anyone has a quicker or easier way of doing this, please let me know. I really just stumbled through this until I put enough puzzle pieces together to get this to work. Thanks.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) 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.