Announcement Announcement Module
No announcement yet.
Is there a way to pass custom privacy settings when posting on User's friend's wall? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a way to pass custom privacy settings when posting on User's friend's wall?

    Basically, what I'm trying to accomplish is to have the application post a message on the logged in User's FRIEND'S wall so this message is only visible to the User and the Owner of the wall the message is being posted on. It seems you can do something like that in php:

    $privacy = array(
    'value' => 'CUSTOM',
    'friends' => 'SOME_FRIENDS',
    'allow' => 'XXXXXXX,YYYYYYY' // Change this to your friends ids
    $params = array();
    $params['privacy'] = json_encode($privacy);
    $params['message'] = "Special for TWO friends";
    $post_id = $facebook->api('/me/feed', 'POST', $params);

    Thank you so much for your help!!!

  • #2
    Spring Social's Facebook API binding does not currently support setting privacy on a post. But that sounds like a good thing and it should support it. Could I ask you to open an improvement issue at and I'll add it to the roadmap.


    • #3
      I see, ok, I will open an improvement issue. What about sending private messages on behalf of the user to his/her friends? Is this supported? Thanks a lot!


      • #4
        I actually modified the Spring Social source to set the privacy parameter. However, running it I got exception signaling that FB does not allow you to set privacy parameter when executing targeted wall posts. Please see below.

        @habuma - Could you please reply to my previous question? Can we send private messages on behalf of the user to his/her friends via SS API?

        2012-06-11 11:22:22,075 [http-bio-8080-exec-5] ERROR service - (#100) The privacy param cannot be applied when a target is specified. Exception: (#100) The privacy param cannot be applied when a target is specified.
        at ookErrorHandler.handleUncategorizedError(FacebookE
        at ookErrorHandler.handleError(FacebookErrorHandler.j ava:63)
        at org.springframework.web.client.RestTemplate.handle ResponseError(
        at org.springframework.web.client.RestTemplate.doExec ute(
        at org.springframework.web.client.RestTemplate.execut e(
        at org.springframework.web.client.RestTemplate.postFo rObject(
        at ookTemplate.publish(


        • #5
          seems problems have been solved


          • #6
            Sorry that I didn't respond to your question quickly enough (I had taken a few days of vacation and wasn't online much in the past few days).

            When you ask if you can send private messages, I'm sorry to say that you can't do that yet either. Facebook's API was in a state of change regarding that functionality at the time when Spring Social 1.0.0 was released and so I purposefully left it out until the API had stabilized. Now that it has stabilized, I have it planned for v1.1.0, but have not yet started work on it. I know that's not the answer you're looking for, but...I will try to carve out some time today or tomorrow to give it another look and see if I can implement it. I'll let you know.


            • #7
              Thank you!
              I was doing an investigation myself and it seems that Facebook API is very tricky when it comes to private messages. I may be missing something, but I couldn't find the FB api for sending a private message. What I found is a javascript FB send dialog which can be integrated into a page. However, this dialog prevents you from sending a private message to more than one friend at a time - something that's critical for me. Amazingly, it seems that FB has whitelisted some of the apps (i.e. by Ebay, Pinterest) to provide them but not others with that feature.

              Please keep me posted about your findings,
              Thank you so much,


              • #8
                @tina09n "seems problems have been solved"

                How so?


                • #9
                  As I reviewed my notes on this, I remembered that an app *can't* send private messages via the API. I believe the reasoning is to avoid having applications send spam to other users on behalf of the user who authorized the application (just speculation...I don't know the real reason for sure).

                  What I had in mind for 1.1.0 is the ability to read a user's mailbox, but not send messages. See

                  But I still plan to look into setting privacy when posting. For that, I see that you created


                  • #10
                    Thanks Craig.

                    When trying to set privacy while doing targeted wall posts I got this error (presumably from FB) :

                    ERROR service - (#100) The privacy param cannot be applied when a target is specified.

                    Please keep me posted about your findings.



                    • #11
                      Yeah, that's definitely a Facebook error. The "(#100)" part of it is a clue, as many FB errors have an error code embedded in the text like that.

                      Sounds like this might not be do-able because of some Facebook limitations. But I'm still poking at it to see what will work.