Reputation: 492
I am trying to post on Facebook with custom privacy setting:
$postRequest=new FacebookRequest($sess,'POST','/me/feed',array(
'message'=>'My first post using graph api ',
'description'=>'new Description',
'privacy'=>array('description'=>'Only Me','value'=>'SELF'),
'link' => 'www.example.com'
)
but an error occurs:
(#100) privacy must contain a valid privacy 'value'
What's wrong?
Upvotes: 2
Views: 1281
Reputation: 22903
You were close. You must encode your PHP array into a JSON array:
'privacy' => json_encode(array('description'=>'Only Me','value'=>'SELF')),
Upvotes: 1