Announcement Announcement Module
No announcement yet.
Send a Request to Multiple Users on Facebook Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Send a Request to Multiple Users on Facebook


    I'd like to implement an App Request feautre to enable users to send invites to facebook friends.

    I pasted below progress so far (not much), throws an error, not sure why?: ception: (#200) All users in param ids must have accepted TOS.

    I'd like it to be "Multiple Friend Selector" where users select one or more people from the request dialog window see -

    I'm not sure how to make the "request dialog window" you see in the link (provided above) appear when user clicks on a "invite friend" button. In addition the publish() method below only takes a single id as opposed to a list of ids.

    Looking for some pointers on how to achieve the above.

    @RequestMapping(value="/facebook/friends/apprequest", method=RequestMethod.GET)
    	public String appRequest(Model model) {
    		RestTemplate restTemplate = new RestTemplate();
    		String clientId= environment.getProperty("facebook.clientId");
    		String clientSecret = environment.getProperty("facebook.clientSecret");
    		String url = "" +
    		String result = restTemplate.getForObject(url, String.class);
    		String appAccessToken = result.replaceAll("access_token=", "");
    		//create the request
    		FacebookTemplate appRequestTemplate = new FacebookTemplate(appAccessToken);
    		MultiValueMap<String, Object> requestData = new LinkedMultiValueMap<String, Object>();
    		String userid = "someID";
    		requestData.set("message", "Sending a request through to you.");
    		appRequestTemplate.publish(userId, "apprequests", requestData);
    		return "home";
    Last edited by Laedislaw; Nov 28th, 2012, 10:34 AM.

  • #2
    I could be wrong, but...Put simply, you cannot send app requests via the Graph API (and thus cannot send them via Spring Social). If you could, then it opens up the opportunity for an application to abuse the feature to spam other users just because one of their friends (soon to be former friend) authorized it.

    Also, one clue to the fact that it's not supported in the Graph API is that there is no extended permission for that case at

    The only way to do this is to have the user explicitly submit the invitation via Facebook's Javascript library. The link you mentioned describes how you do that with FB.ui().