3

We developed a system which interacts with Facebook using the Graph API. In this case, I am trying to post a message in a group and I am with the following return:

My request in this Graph well:

v2.3/402998003100416/feed?message=hello

And the return is this:

{
  "error": {
    "message": "Permissions error", 
    "type": "FacebookApiException", 
    "code": 200, 
    "error_subcode": 1376025, 
    "is_transient": false, 
    "error_user_title": "No Permission to Post", 
    "error_user_msg": "You do not have permission to post in this group."
  }
}

Obviously the problem is that the group's privacy is "closed" and I could only publish if it were a member, but I have not asked to participate in the group. My intention is precisely this, use the Graph to submit a request to join the group, something like clicking the "+ Group Join" facebook button itself. How to do it?

Leveraging the same way, I wonder if I can enjoy one fan page for the graph api.

ekad
  • 14,436
  • 26
  • 44
  • 46
Anderson Nunes
  • 279
  • 3
  • 14
  • 1
    You can't do that using the API. Why would you want to post in a group you are not a member of? – WizKid Apr 02 '15 at 01:51
  • my intention is to be a member in question ! I would like to send the request to join the group via api , has not to like? I have read something in the documentation said to send a post this way group_id / members / user_id but not working with me . – Anderson Nunes Apr 02 '15 at 02:02
  • 1
    Well then simply ask to join the group via the interface that facebook.com provides … – CBroe Apr 02 '15 at 02:22
  • 1
    How many groups are you planing to join? Why not just go to Facebook.com and do it? – WizKid Apr 02 '15 at 03:32
  • The application will run in a company with many service providers , who can post , comment and follow the processes through thousands of existing groups created by the company and the persons related to it. The vast majority of users do not participate in groups , if possible send the direct invitation by the application would be a great help. But how then do not give 'll find another way . – Anderson Nunes Apr 02 '15 at 13:35

1 Answers1

6

Apps can only invite users to a group created by that App, as you can read in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.3/group/members#publish

It is NOT possible to send requests or invites to normal groups with the API.

For creating a post in a group, you would need publish_actions and user_groups: https://developers.facebook.com/docs/graph-api/reference/v2.3/group/feed#publish

Keep in mind that you will most likely not get user_groups approved:

This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available. For example, Android and iOS apps will not be approved for this permission. In addition, Web, Desktop, in-car and TV apps will not be granted this permission.

https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-user_groups

Edit: Facebook recently released a new permission user_managed_groups for accessing groups the user is an admin of.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Facebook recently released a new permission `user_managed_groups` (v2.3) that allows you to read and schedule posts to groups the user is an admin for https://developers.facebook.com/docs/facebook-login/permissions/v2.3#user_managed_groups – yellowaj Apr 30 '15 at 14:33