Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to post Facebook Page updates using ruby fb_graph?
    primarykey
    data
    text
    <p>I simply would like to automate posts to Facebook for certain events to my corporate Facebook Page. It seems as though it should be straightforward from what I've read thus far, however I am running into a roadblock.</p> <p>An example of some code I have and the error is as follows:</p> <pre><code> user = FbGraph::User.me(access_token) user = FbGraph::User.fetch('PageName') FbGraph.debug! # yields true user.feed!( :message =&gt; 'Updating via FbGraph', :link =&gt; 'https://domain.tld', :name =&gt; 'PageName', :description =&gt; 'This is a test post to be deleted' ) </code></pre> <p>This returns the following error:</p> <pre><code>======= [FbGraph] API REQUEST STARTED ======= POST /234062246478665/feed HTTP/1.1 Content-Type: application/x-www-form-urlencoded Content-Length: 124 Host: graph.facebook.com message=Updating+via+FbGraph&amp;link=https%3A%2F%2Fdomain.tld&amp;name=PageName&amp;description=This+is+a+test+post+to+be+deleted -------------------------------------------------- Status: 403 Forbidden Access-Control-Allow-Origin: * Cache-Control: no-store Content-Type: text/javascript; charset=UTF-8 Expires: Sat, 01 Jan 2000 00:00:00 GMT Pragma: no-cache WWW-Authenticate: OAuth "Facebook Platform" "insufficient_scope" "(#200) This API call requires a valid app_id." X-FB-Rev: 541309 X-FB-Debug: JN9/Vt8MN24GNUL34l8TE2cDuCRZZehdUTx2KkOrHQ8= X-Cnection: close Date: Mon, 16 Apr 2012 18:55:20 GMT Content-Length: 0 {"error":{"message":"(#200) This API call requires a valid app_id.","type":"OAuthException","code":200}} ======= [FbGraph] API REQUEST FINISHED ======= /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/fb_graph-2.4.10/lib/fb_graph/exception.rb:55:in `handle_httpclient_error': OAuthException :: (#200) This API call requires a valid app_id. (FbGraph::Unauthorized) from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/fb_graph-2.4.10/lib/fb_graph/node.rb:145:in `handle_response' from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/fb_graph-2.4.10/lib/fb_graph/node.rb:54:in `post' from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/fb_graph-2.4.10/lib/fb_graph/connections/feed.rb:15:in `feed!' from ./test_script.rb:168:in `block in &lt;main&gt;' from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:239:in `block in each' from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:238:in `upto' from /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/nokogiri-1.5.2/lib/nokogiri/xml/node_set.rb:238:in `each' from ./test_script.rb:85:in `each_with_index' from ./test_script.rb:85:in `&lt;main&gt;' </code></pre> <p>On <em>developers.Facebook.com/apps -> Settings -> Auth</em> Dialog I am setting the <code>Extended Permissions</code> to include <code>publish_stream</code> and <code>status_update</code>.</p> <p><strong>I have found that <code>curl</code> access with the same token does indeed work as follows:</strong></p> <pre><code>curl -F 'access_token=MY_BIG_OLE_LONG_TOKEN' -F 'message=testing message' https://graph.facebook.com/MyPage/feed </code></pre> <p>Am I missing the setting of a permission somewhere or not calling the api correctly with the <code>fb_graph</code> ruby gem? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload