I am trying to use fb_graph_publish_action to publish to facebook. I followed the instructions located here http://www.drupalforfacebook.org/node/2630 and I fixed a few problems along the way. I am now stuck on an issue with the fb_graph function/module. I'm not sure if the path is wrong or what, but I am getting a Bad Request response.

Here is a copy of the log entry of the caught exception:

Failed to publish post action.: fb_graph failed querying 29901904/:post. Bad Request 400

Comments

Dave Cohen’s picture

This path for fb_graph looks wrong: "29901904/:post". What exactly are you passing to fb_graph_publish_action()? Or are you calling fb_graph directly?

If "I fixed a few problems along the way" means problems with modules/fb or the snippet on drupalforfacebook.org, why don't you share the fixes with us?

zhuber’s picture

Sorry for the confusion about the "fixes" along the way, what I meant to say was that I already troubleshooted some issues with the primary app settings that were causing it not to work initially. I didn't actually patch anything, just had to figure out some of the configuration settings - which I found in other issues for this module.

I am calling fb_graph_publish_action with this code snippet:

$url = url('node/' . $content_id, array('absolute' => TRUE, 'fb_canvas' => FALSE));
$publish = fb_graph_publish_action('post', array('article' => $url));

When I output var_dump($url), I get this value for the URL "http://la.nyx/content/208-rodeo". This is a valid content URL for my local environment.

I think I've found the problem, my app may not be configured correctly. When I look at the path generation, I see that it requires canvas settings.

// @TODO: handle apps that have no canvas page.  how???
$path = $fbu . '/' . $fb_app->canvas . ':' . $action;
$result = fb_graph($path, $params, 'POST');