• Hello and welcome to our new forums. We upgraded our forum sites to a more robust and modern system which we hope you will enjoy. Be sure to check out your profile by clicking the button on the top right and configure your preferences, signature, time zone, avatar, etc. as you wish. If you need help with using this new forum'ware try the help link on the bottom right.

    Click here to review your account now.

Question Post on Facebook Page Error: (OAuthException - #200)


New member
Apr 2, 2013
Programming Experience

I created a web page in Visual Studio 2005 in order to post messages on my Facebook Page and i'm using .Net Framework 4.0.
I downloaded and added as a reference in my project:
- Facebook 6.4.2
- System.Dynamic.Dll
- Newtonsoft.Json.dll (for .net 4.0)

When i try to run my project i got the following error message: (OAuthException - #200) (#200) The user hasn't authorized the application to perform this action
What i'm doing wrong ? Can you help me to fix the error ?

Thank you


Here's my C# Code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;

using System.Net;
using System.IO;
using System.Text;
using System.Collections.Specialized;

using System.Dynamic;

using Facebook;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

public partial class fb : System.Web.UI.Page
    private const string FacebookAppId = "123456789012";
    private const string FacebookAppSecret = "b9s7xkd8d88a8dc9v9vlx9s8kcv9c0s8";

    private const string AuthenticationUrlFormat =

    protected void Page_Load(object sender, EventArgs e)
        string accessToken = GetAccessToken(FacebookAppId, FacebookAppSecret);
        PostMessage(accessToken, "Test message");

    private string GetAccessToken(string apiId, string apiSecret)

        string accessToken = string.Empty;
        string url = string.Format(AuthenticationUrlFormat, apiId, apiSecret);

        WebRequest request = WebRequest.Create(url);
        WebResponse response = request.GetResponse();

        using (Stream responseStream = response.GetResponseStream())
            StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
            String responseString = reader.ReadToEnd();

            NameValueCollection query = HttpUtility.ParseQueryString(responseString);

            accessToken = query["access_token"];

        if (accessToken.Trim().Length == 0)
            throw new Exception("There is no Access Token");

        return accessToken;

    private void PostMessage(string accessToken, string p_message)
            FacebookClient facebookClient = new FacebookClient(accessToken);

            var args = new Dictionary<string, object>();
            args["message"] = p_message;
            args["caption"] = String.Empty; // "Caption";
            args["description"] = "test description";
            args["name"] = "Name";
            //args["picture"] = "";
            //args["link"] = "http://www.google.com";

            args["req_perms"] = "publish_stream";
            args["scope"] = "publish_stream";
            args["access_token"] = accessToken;

            //Then pass your destination ID and target along with FB Post info. You're Done.
            dynamic publishedResponse = facebookClient.Post("/" + PAGE_ID + "/feed", args);

        catch (FacebookOAuthException ex)
             //handle something
            Response.Write("FacebookOAuthException = " + ex.Message.ToString() +"<br />");

        catch (Exception ex)
             //handle something else
            Response.Write("Exception = " + ex.Message.ToString() + "<br />");

Last edited by a moderator:


New member
Apr 2, 2013
Programming Experience
Do you have a C# example that i can integrate it in my code ?


C# Forum Moderator
Staff member
Apr 23, 2011
Sydney, Australia
Programming Experience
I've never used OAuth before so no but, from the sound of the error message, I would suggest that your code may well be fine and it's a matter of appropriate permissions being set elsewhere.
Top Bottom