Facebook API - How to add application to group in developer mode - facebook

I have troubles with adding my application to group for any test user.
I've created two test users and one of them has group and he is an admin there and I wrapped those users into test application.
I've added two permissions for groups (groups_access_member_info, publish_to_groups). In user settings I see my application but in group settings I can't add my application.
I need this because I would like to make request from facebook graph API.
Regards

In order to test the Groups API with an app in development mode, you need to be an admin of both the app and group. Test users don't count as admins of the app. Therefore, you'll need to use a real user account.
You don't have to add the app to the group, it is assumed that the app is added if you are the admin of the group.
Source: Facebook Platform Bug Report.
Additional information from another useful bug report:
to read group information (such as the /events edge on a group), the app needs to have the "Groups API" feature reviewed and approved,
and the app needs to be installed to the group. No additional
permissions are required on the access token.
to read information about the members of a group, the access token needs to have the groups_access_member_info permission granted during
login, and the app must have been approved for the "Groups API"
feature.
to publish to a group, the access token needs to have the publish_to_group permission granted, in addition to the app having the
"Groups API" feature
When testing this with your own groups in development mode, the Groups
API feature is assumed to be enabled, and when querying groups that
you manage, the API will behave as though the app is installed to your
group. Note that when querying group posts, you may only receive posts
made by yourself or other admins of the app.
When querying your group's events with your app in development mode,
the call worked as you didn't need any additional permissions on the
access token, and the API behaves as though your app is installed on
the group. This is similar to how this would work in production, as
the access token wouldn't need any additional permissions to be
granted during login.

To add your App to a Facebook Group in development mode so as to use the Groups API, you'll need to follow these steps
Ensure you are an Admin to both the App and the Facebook Group.
Create a Test version of your App from the main App, this enables you to use the Test App in a Facebook Group without needing to add the App to the Facebook Group or you'll get an OAuthException using the main App, see the docs.
Don't bother looking for the Test version of your App in the group app store as the Test App is bound automatically to any Facebook Group you are an Admin to.
Add the required permissions Groups API would use in a standard App see the docs like groups_access_member_info and publish_to_groups to get the most out of the Groups API.
Add Test Users to the App for them to see your posts made with the Test version of your App see the docs. This is not a must see the note below.
If you're testing with the Graph API Explorer change the Facebook App to the test version of your App to prevent an OAuthException.
Congrats! You can now use the Groups API with a Test version of your App to post to the Facebook Group you are an Admin to.
NOTE: Only your Admin account and the Test Users you add to the App can see the posts made with the Test version of your App, meaning mutations to Facebook are private to you an Admin and the Testers till you submit your App for review which you can read about here.

Related

How do I get access to my customers account from my facebook app?

I created a facebook app (which is currently in dev stage, hence not approved by FB yet).
I need to get the daily ads insights reports for all my customers, so I need them to grant access for my app (ads_read).
I do not understand and cannot find it in the documentation, how do I get my customers to grant me (my app) access to their ads accounts.
Do I need to setup a Business Manager?
thanks
I tried using app token but it only accesses my accounts
There are two options:
Add them to your App as Test Users, so they can use the permissions without review
Go through review with the neccessary permissions
An App Token does not have any relation to a User, so you cannot even get access to your own Ads with that one. You are probably talking about a User or Page Token.
More information about Tokens: https://developers.facebook.com/docs/facebook-login/access-tokens/

Cannot post to group using test user in app

Logged in as Test User to post to group in app while in development mode, but failed.
According to this bug report
https://developers.facebook.com/support/bugs/374244166706163/
It works only when I'm an admin of both the app and group.
To request Groups API permission in App review section, I have to reproduce my application's functionalities using a test user.
How am I supposed to do that if my developer account is the only one able to successfully post to group?

When do I need to submit my app for Facebook review (when only reduced group of people will use it)?

I am creating an app that only a specific list of users will use, and I need Instagram Public Content Access permission (and some other permissions) for them (I have my Instagram Business Account all set up and connected with Facebook page).
On https://developers.facebook.com/docs/facebook-login/review/examples/#screencast there is stated:
You do not need to submit your app if it will only be used by you or
by a reduced number of people. Any account listed in the Roles tab in
your App Dashboard, such as admins, developers and testers, can access
all permissions and generate a user or page access token.
So I just want to make sure, that it is completely fine in my case to keep my app in development mode and let my users use it like this (so I don't need to submit my app for review as long as all the users are going to have their role assigned in my app), and that these permissions are not intended just for a limited time period or only for testing/development purposes.
Thank you for any answer.
What you quoted there, is applicable to permissions your app is going to ask its users to grant to it.
Instagram Public Content Access is not a permission, it is a feature. You need to get it reviewed, if you want your app to be able to access content that the users of your app do not have admin access to.
https://developers.facebook.com/docs/apps/review/feature/#reference-INSTAGRAM_PUBLIC_CONTENT_ACCESS

How my App can read the group feed/posts on a group of a test user?

According to the Facebook Groups API, my Facebook App can read the feed of a group only if an admin of that group installs it on the group:
By installing your app on a group, a group admin can grant your app access to group content, such as posts, photos, and videos, and allow you to publish content to the group on behalf of the admin.
I have a Facebook App with test users. On one of the test users, I've created a group with some posts. Using the API token of this test user, I can see the group calling the /me/groups API.
The problem is that I still can't see the posts on the group through the /{group-id}/feed API. As the docs said, the admin of the group needs to install the app on the group. But when I go to the the Edit Group Settings option of the group, and click on Add Apps, I can't find my app on that list, and can't install it on the group.
So, how do I configure my App to make it appear on the Browse Apps for This Group list of the group of the test user? Or there is another way to read a group feed in order to submit my App to Facebook Review?

Facebook Ads Api Request fails with #273 requires user to be admin

I'm trying to query the Facebook Ads API with the Graph Api Explorer. I have two Ads Account connected to me (if i query /me/adaccounts/ I see both) one is my own and the other one I'm only admin on but not owner.
The Problem is with the one I'm not the owner. If I query my Adaccount with /act_<ACT_ID/stats I get a normal response with the stats back if I query the other account i get:
(#273) This Ads API call requires the user to be admin of the ad account. User <MY_USER_ID> not admin on ad account <ACT_ID>.",
I can see both Adaccounts normal in the Facebook Adsmanager.
What I have done to get the response is:
Create an Facebook App
Added the Adaccount under developer.facebook.com -> myApp -> settings -> advanced -> advertising accounts -> Ads API. Account
open GraphExplorer (https://developers.facebook.com/tools/explorer/)
select my created App
get AccessToken (ads_management, ads_read)
go to url me/adaccounts/
if i click on my adaccount it works if i click on the other i get the #273 error
I don't see what I'm doing wrong if someone could point me in the right direction I would be gratefull.
This may be due to your ad account is inactive or in a bad standing. Additionally if your access level of your ad account is in development level these types of errors may occur. please go through what's mentioned on the doc here
If you upgrade your account to basic or standard access levels this will be solved.
On development access level only end to end workflows are suggested. The following text is extracted from facebook documentation.
The development access level is designed for development purposes and is ideal for people who are just starting to build out their tool. In this level, you would not yet have customers using your tool. This level is open to all developers, and is intended to build out end-to-end workflows on the API before you get full permissions.
A similar issue has been reported on facebook bug reports. you can see the thread here
As #Igy stated it in a comment: "a user has to be the admin of both the ad account and the app (and not just an advertiser or have some other role on the ad account)".
There is 2 places to check that:
the app's roles page, https://developers.facebook.com/apps/[APP_ID]/roles/
the account's peoples page, https://business.facebook.com/settings/people/
Once the user is admin on both side, the API calls will be just fine.
Your business manager doesn't have admin rights. Please check the admin rights of the business manager and also add the app in your business manager to get the report stat(https://developers.facebook.com/docs/apps/business-manager#update-business).