Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Graph Batch, only takes top-level access_token
    primarykey
    data
    text
    <p>I'm using the Facebook Graph Batch API to send one message / different messages to registered people's FB walls. I'm defining an access_token for each user, and the obliged top-level access_token (used as fallback, according to the <a href="https://developers.facebook.com/docs/reference/api/batch/" rel="nofollow">doc</a>). For the latter I just use an access_token from the users listed in the batch.</p> <p>The thing is that the only user recieving the message, is the one who's access_token I used as the top-level/fallback access_token. The other users get the "(#210) User not visible" error message. I'm using 3 test users setup at my app-roles.</p> <p>Any idea what goes wrong here?</p> <p>Here's my code (python) for generating one message to all registrants:</p> <pre><code> for soc_reg in self.registrants: batch_item = { "method" : "POST", "relative_url" : FACEBOOK_URL_FEED % (soc_reg['uid']), "body" : Helper.toURL(publishParams), "access_token" : soc_reg['access_token'], } batch.append(batch_item) params = { "access_token" : self.registrants[0]['access_token'], # used as fallback "batch" : Helper.toJSON(batch), } </code></pre> <p>results in following value for "params":</p> <pre><code>{"access_token": "XYZ", "batch": "[{\"body\": \"caption=&amp;message=is+not+a+test.%0D%0AWe%27re+just+rappin%27+to+the+beat%21&amp;place=146270405429726&amp;link=&amp;description=\", \"access_token\": \"XYZ\", \"method\": \"POST\", \"relative_url\": \"/100003720771245/feed\"}, {\"body\": \"caption=&amp;message=is+not+a+test.%0D%0AWe%27re+just+rappin%27+to+the+beat%21&amp;place=146270405429726&amp;link=&amp;description=\", \"access_token\": \"ZYX\", \"method\": \"POST\", \"relative_url\": \"/100003671211957/feed\"}, {\"body\": \"caption=&amp;message=is+not+a+test.%0D%0AWe%27re+just+rappin%27+to+the+beat%21&amp;place=146270405429726&amp;link=&amp;description=\", \"access_token\": \"YZX\", \"method\": \"POST\", \"relative_url\": \"/100003683601909/feed\"}]"} </code></pre> <p>So the only user recieving the message is the one defined here: "access_token" : self.registrants[0]['access_token'] When I adjust the index, I can determine the one recieving the message ;)</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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