24913

Facebook Error (#200) The user hasn't authorized the application to perform this action

I have the following:

// my facebook page var pageId = facebookPageId; var app = new FacebookClient(); dynamic fbResult = app.Get("oauth/access_token", new { client_id = facebookAppId, client_secret = facebookAppSecret, grant_type = "client_credentials" }); app.AccessToken = fbResult.access_token; dynamic messagePost = new ExpandoObject(); messagePost.access_token = app.AccessToken; messagePost.link = "www.google.com"; messagePost.name = "some name"; messagePost.caption = "{test actor} " + "Test message"; //<---{*actor*} is the user (i.e.: Aaron) messagePost.description = "Test description"; try { var result = app.Post("/" + pageId + "/feed", messagePost); } catch (FacebookOAuthException ex) { var test = ex; } catch (FacebookApiException ex) { var test = ex; }

Yet I always get (#200) The user hasn't authorized the application to perform this action as a result. What am I doing wrong? It's a page that I own - but I don't see how to go about granting POST permissions to my app.

Answer1:

The user needs publish_actions permissions. Implement a login dialog for the user to grant publish_actions

You are using an application access token.

Recommend

  • POST to /likes only works after GET - bug or by design?
  • Can't understand the Exception when using dynamic with generic collection in .net4
  • How to add dynamic member name and value to an instance of ExpandoObject class?
  • transpose 2D array that exists as IEnumerable of IEnumerable
  • Entity Framework Core: Include many-to-many related objects in WebAPI
  • Java : Simple XML not parsing the xml. Gives Exception
  • In Akka, is ActorContext thread safe?
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • Problems compiling files using JOGL
  • Webgrid not refreshing after delete MVC
  • HTTP/2 streams vs HTTP/1.1 connections
  • Python urlparse: small issue
  • Jquery UI tool tip close icon
  • NHibernate Validation Localization with S#arp Architecture
  • Seeking advice on Jetty HttpClient Hang
  • How can I send an e-mail from a vbs script
  • Display issues when we change from one jquery mobile page to another in firefox
  • Deselecting radio buttons while keeping the View Model in synch
  • Optimizing database types to compact database (SQLite)
  • Spray.io: When (not) to use non-blocking route handling?
  • Accessing IRQ description array within a module and displaying action names
  • Cross-Platform Protobuf Serialization
  • JSON with duplicate key names losing information when parsed
  • Do I've to free mysql result after storing it?
  • Jquery - Jquery Wysiwyg return html as a string
  • Google cloud sdk not working when python points python3
  • Traverse Array and Display in markup
  • using HTMLImports.whenReady not working in chrome
  • Getting Messege Twice Using IMvxMessenger
  • Turn off referential integrity in Derby? is it possible?
  • Qt: Run a script BEFORE make
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • Android Heatmap on canvas or ImageView
  • Python/Django TangoWithDjango Models and Databases
  • java string with new operator and a literal
  • Net Present Value in Excel for Grouped Recurring CF