I have an access token for a FB app that will be used of oAuth registration. Because I do not have a FB account I have created a test account. However when trying to log in using the test users credentials I get this error:
App Not Setup: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.
This error is answered in other Stack Overflow questions using the app dashboard. However I don't have access to the dashboard so I decided to add a role for the newly created user by hitting the roles endpoint.
I have defined the endpoint like this:
'https://graph.facebook.com/APP_ID/roles/?access_token=APP_ACCESS_TOKEN&user=TEST_USER_ID&role=testers'
The response code is 200, but when I list the roles of the app nothing is changed, still the admin role is the only role listed. Seems weird that the test user doesn't get a role automatically when created when the associated APP ID and secret are used. I feel like I am missing something here, maybe someone experienced with this can point me in the right direction?
Response:
{'data': [{'app_id': 'app_id', 'user': 'app_user_id', 'role': 'administrators'}], 'paging': {'cursors': {'before': 'MAZDZD', 'after': 'MAZDZD'}}}
Which is an array of one element, the admin for the app, no test account role found.
My question is if it's possible to use the graph API in order to register this test user to the app?
Related
The old developer on my facebook chatbot stopped working on the project and was removed from the 'Admin' role by another Admin.
Now, facebook returns:
{"statusCode":400,"id":"1234567","fbCode":190,"fbErrorSubcode":492,"fbMessage":"The user must be an administrator, editor, or moderator of the page in order to impersonate it. If the page business requires Two Factor Authentication, the user also needs to enable Two Factor Authentication."}
instead of replying to a user.
How do I resolve this?
Edit to add:I think this is mostly related to the PAGE_ACCESS_TOKEN variable. How do I change the PAGE_ACCESS_TOKEN that facebook creates for API use? The old(current) PAGE_ACCESS_TOKEN is linked to his account.
The old dev must have been using his personal credentials for the chatbot, so when he was removed from the page as an admin, the service stopped letting his credentials access it for chatting.
You'll need to get the app updated with different credentials.
The key was to also remove the admin from the app admin role. This allowed the creation of a new PAGE_ACCESS_TOKEN that never expires.
What I want to do is to be able to create and publish FB ads from my fb account and publish it on other users fb pages using fb api.
User can install my app which will ask for manage_pages+business_management permission along with some other needed permissions.(this part is done for test app and it's working) and then users can create fb ads on my platform and connect there pages to the ad they have created.
I am able to create fb ads also from my platform but not able to connect users pages to my fb ads.
I have one main account with business manager + app(dev mode) connected to it + system users, test account etc..
so far I have figured out that I have to add the other fb user pages to my business pages and to do that according to the doc, first I have to install the app for system users by using below curl request.
https://developers.facebook.com/docs/marketing-api/businessmanager/systemuser/v2.10
Installing Apps
A system user or an admin system user must installĀ the appĀ that will be used for generating the token. That means to allow the app to call APIs on behalf of this system user or admind system user. Both system user and app should belong to a same business manager
To install an app for a system user you need following things:
* access_token: of an admin user, admin system user, or another system user if generated
* business_app: the app ID being installed
To install an application for system user, make a POST request as shown in the example below:
curl \
-F "business_app=APP_ID" \
-F "access_token=ACCESS_TOKEN" \
"https://graph.facebook.com/API_VERSION/APP_SCOPED_SYSTEM_USER_ID/applications"
This call will return a boolean result indicating installation was successful. If any of the restrictions are not met, you will see appropriate error message.
but it never works...
my first question is before going any further
Is it even possible to install the test app which is always in development mode for system users?
if the answer is "No" then i'll have make my main app live and submit it for review so I can needed permissions which are not there in main app which doesn't sound reasonable to me, I should be able to do this with test app in dev mode.
but if the answer is yes then please let me know how.
When I try I always get this error
Error: Requires business_management permission to manage the object
I have added system user to Advert account as an admin
I have added system user to test app as an admin
I checked business_management checkbox when I created the system user token
any help is highly appreciated!
ps: pls correct me if you think this is not the right way to achieve my goal
Well if someone comes around to this page for looking for an answer then it's damn simple, special privilege is required to do this and you'll have to contact facebook. it's that easy -_-, still haven't got the privilege yet so can't add anything else...
I have to integrate facebook custom audience apis with my application which handles users fb marketing.
After I log the user in to get the access token with all the relevant permissions like ads_read,ads_management and business_managment.
I am getting an error while trying to fetch the custom audiences for the client
type: OAuthException, code: 272, message: (#272) This Ads API call
requires the user to be admin of the application. User is not admin or
developer of this application., x-fb-trace-id: H6HzozvlbXp [HTTP 400]
Am I missing something in this or does facebook not allow for such a scenario or is it because the app is in development mode.
P.S I did try to add another admin https://www.facebook.com/ads/manager/ but no option for an app in the same.
While in development mode, you'll need the users to be admins of your app. Go to developers.facebook.com, select your App from the drop down on the top right. Click Roles on the menu on the right. Add the user as an admin. You may also need to add the ad account under Settings->Advanced->Authorized Account IDs.
I have a desktop app which uses a user access token to read the me/feed endpoint and I can see all the posts for the logged in user. If I wanted to simplify deployment to different users I would need to minimise the amount of setup/configuration they did.
Is there a way to access me/feed for a given userid rather than have to setup every user as a developer account and create an app for it?
I have looked at https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0 and it is not obvious to me how to do this.
What configuration / permissions does the user in question need to do to activate this. Which access token should I be using, and will it give access to all the posts in the same way the user access token does.
[EDIT] I have looked at this again and the problem I am having is that when a user (who has a facebook account but is NOT a developer) tries to login to my App (which is in development mode) I get the following error
"App Not Setup: The developers of this app have not set up this app properly for Facebook Login."
Thanks in advance
When going to the 'apps' link in the topmenu on http://developers.facebook.com, it always redirects me to the Ads Management page. I closed my Ads-account 1 week ago, but this does not help. It's really annoying b/c I can't manage or add any apps now.
I have already understood that it's due to the fact that the apps were created when my account was still a 'personal' account and once I started to use the Ads in Facebook, it was switched into a 'Ads account'.
(see also: http://facebook.stackoverflow.com/questions/8507163/redirection-to-campaigns-facebook-ads-page-why)
But, now that I want to adjust the apps that I have previously created, how can I do that?
Use the Login process with the business account, in the same way you log in your app's regular users
Once you've done this as the account which is an admin of the app, you can use the resulting access token to access the API and add other admins.
Provided you authorise your app with the business account via the Oauth dialog, you can use the admin's access token to add additional admins.
The method for doing so is outlined on the 'Application' documentation - you make a HTTP POST request to the roles connection of the App using with the parameters app_id, user and role - set 'role' to 'administrators' to add an admin with the ability to delete the app