(# 100) At least one reference object must be specified - Simple POST of OG action

I am using the PHP SDK to try to publish a simple action using the Graph API.

I created an object called 'Competition' and an action called 'Enter'. Thus, the user enters a contest.

My code looks like this:

try { $statusUpdate = $this->data['facebook']->api('/me/lovepoppycompetition:enter', 'post', array( 'competition' => 'https://apps.facebook.com/lovepoppycompetition/' )); echo '<pre>SUCCESS: '.print_r($statusUpdate, true).'</pre>'; } catch(FacebookApiException $e) { echo '<pre>FAILED: '.print_r($e, true).'</pre>'; } 

I get an error (FacebookApiException):

 (#100) At least one reference object must be specified 

I'm not quite sure why, especially since I use this code (with different objects / actions) in another application, without any problems itโ€™s just fine.

Perhaps itโ€™s worth noting that I didnโ€™t post the action, although I donโ€™t think I need it to work for me?

Thanks in advance.

+6
source share
2 answers

This was caused by an FB error, which is now resolved.

0
source

I think the problem is that you are redirecting the action back to the facebook application. You must create a competition page on your website and use it to redirect users to your website.

Make sure you use the correct og tags on the redirect page.

0
source

Source: https://habr.com/ru/post/915492/


All Articles