Is it possible to add a Facebook user to the "Tester" role on a Facebook app through one of the Facebook APIs, without an admin user having to manually add the user to the "Tester" role on the App settings?
Thanks in advance.
The API Reference says yes, and there is example code: https://developers.facebook.com/docs/graph-api/reference/app/roles#publish
Be aware:
A user access token for any admin of the app is required.
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.
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'm using OAuth authentication to obtain a token from a Facebook user. My application edits - among other stuff - their Facebook pages. With that token I obtain a permanent token.
The user can unlink its Facebook account from my app. When a user does so, I like to invalidate the token and remove my app from the users apps. It this possible?
Have a look at https://developers.facebook.com/docs/facebook-login/permissions/v2.0#revoking You can use
DELETE /{user-id}/permissions
to revoke a user's login to your app.
Furthermore, there's a section in the app's -> settings -> advanced screen where you can specify a so-called "Deauthorize Callback URL". This URL will be called by Facebook if a user actively disconnects your app from his profile settings. Unfortunately I can't find any docs on Facebook concerning this anymore. But there's a question about that here on SO: Facebook user deauthorizes the app
#tobi solution didn't work for me, I had to pass the access token.
DELETE /{user-id}/permissions?access_token={access_token}
I'm using the Facebook C# SDK from the web application associated with our Facebook application. I'm in the "Administrator" role for the Facebook application - how do I check for that role from my web app?
There is a way of doing this via the accounts property on the user. It gives you an array of pages and apps for which the user has admin privileges.
Unfortunately it will require quite a scary extended permission from September: manage_pages.
Try having a play with the new Graph Api Explorer. Click on the accounts connection (in the right-hand column) for your user.
there's another way:
you can also access the app roles directly via the graph api and you need only the app access token therefore.
https://graph.facebook.com/APP_ID/roles?access_token=APP_ID|APP_SECRET
i have problem when user login then i want to show the user profile data in my UIView.
How can i access user profile from facebook when user gets login?
anyone suggest some solution would be great.
Thank You.
You'll need to implement their Facebook Connect method. Start out on Facebook's own developer wiki here:
http://wiki.developers.facebook.com/index.php/Facebook_Connect_for_iPhone