Facebook API page subscription - facebook-graph-api

I am trying to subscribe other's Facebook user's page to my application. Application has permissions like pages_messaging, public_profile, etc. Basically this is a messenger. But it complains and keep saying that I need a "manage_pages" permission. Why? I can't find docs in FB api regarding it. Thanks

Hi you should apply for manage pages permission in your app.To create a subscription you should have the manage_pages permission.
https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps

Related

Facebook Graph API Webhook for Manage Page Livestreaming

I'm trying to get a webhook for a user's managed page going live and I've got the live_video webhook subscription in my Facebook App dashboard, but it's not going for my managed pages or those that I authorize when I authorize my app. I am using the pages_show_list scope so that my app is aware of the pages but that doesn't seem to be enough.
I needed the manage_pages scope, and thus app review.

Get instagram ID from facebook graph API without manage_pages permission

I'm creating an app that's using facebook login to get instagram follower insights. Currently I've followed and and successfully made the soloution written here: https://developers.facebook.com/docs/instagram-api/getting-started/
But here's the problem. Facebook won't approve the "manage_pages" permission for my app. Without manage_pages I have no idea how to get the instagram account id.
I've tried for a couple of weeks now, and facebook won't give any explanation other than "This permission is not required for your app's intended function, or it doesn't appear to enhance the user experience" and then referencing this https://developers.facebook.com/docs/facebook-login/permissions
I currently have a facebook support ticket regarding the issue but they haven't replied for almost 2 weeks. And I'm getting a little desperate.
Using below URL for version 3.0 and 3.2 to get the instagram accounts - It works with "manage_permissions" but without it the response is empty.
me/accounts?fields=name,id,access_token,instagram_business_account{id}
Facebook has finally replied to my support ticket and accepted my app review! The approach and guide I was using above was correct.
I have similar problem to get Instagram Id without extra manage_pages permission. I see no point to ask users for manage page permissions (just read it - its includes ads/create/delete etc permissions, crazy) just to get their Instagram accounts id connected to the page. I've found pages_read_engagement permission will provide this data! So, read only permission fixed my problem. Try it! Its better than manage_pages I guess.

Unable to get ad insights in Facebook's Marketing API

As described in the marketing API, I have registered an app got my app key and and id, generated a token with ads permissions, list pages permission as well. The app is not yet submitted for approval.
When I try to get the list of ad accountsz linked to 'me' it returns the array of all ad accounts.
But when I select any of the business accounts (other than my personal Facebook account) and try to retrieve the ads insights API throws exception saying:
but when I try to get the insights, using the python SDK, I get the same error, ex: (#273) This Ads API call requires the user to be admin of the ad account. User is not admin on ad account .
What is surprising is when I use the similar sample page from Facebook-Developers to get insights, it is able to retrieve the ads data for the same account, with my own login itself.
Why would my app be unable to do so?
Is there any such limitation for apps not reviewed?
Update: I seem to have admin access to the ad account as well. Here are some screenshots. (Unless its my dumb day I think something else is going on, but its my fist time with an API like this, so I cant be sure!;) )
Screenshots: GraphAPI Explrer with API call, App Settings, AdAccount Settings
Based on the discussion on question and experience I now have:
API user needs to be an admin of the ad account and of the app if you
wish to use the API.
The ad account needs to be specifically added to the app, in app settings. In developer access an app can only have access to a maximum of 5 ad accounts.
Error messages in Facebook API are misleading more often than not. Fix anything marked in yellow or red anywhere in the portal, to be
sure.
Do read about limits of every API before you use it, all API have different limits and your application design needs to take those into account.
As for the question, yes the issue was the text in red, as pointed out by #CBroe, although the error message was off by a mile and issue occurred only when using our own app.

Is it possible to get a list of facebook pages with insights access without the "manage_pages" permission?

I'm trying to find out if a Facebook User is able to view the insights of a certain Facebook page. I know that this is possible using the Open Graph API with an access token that has the "manage_pages" permission. Is this the only possible solution? I don't want to request the "manage_pages" permission just to find out if this certain user can view the insights. My app only requests the "view_insights" permission and I'd like to keep it that way.
If its a specific page then you can get <PAGE_ID>/insights with the Graph API, all it requires is read_insights permission.
For getting list of pages a user administrating using either Graph API (<USER_ID>/accounts) or FQL (SELECT page_id FROM page_admin WHERE uid=<USER_ID>) you'll have to request the manage_pages permissions

Is it possible to get access token for multi Facebook user?

I created web application using Facebook C# SDK 5.3.2. I can post messages to my wall. But I want to collect access tokens for my friends' Facebook accounts and store them to use later to post messages to their wall.
Is it possible to get their access token with their Facebook account info. I can get access token for myself with "App ID" and "App Secret. Do I need also add application for my friends' Facebook to get this credentials.
You don't need to store access_token for any user, since it's something time based.
Instead ask for publish_stream permission and post messages to their wall using application access_token
From Facebook documentation on publish_stream permission:
Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time, without requiring offline_access. However, please note that Facebook recommends a user-initiated sharing model.
the only way to get it done, is that your friends login into your application with their accounts and grant you the publish permission (if you want to publish when they are online) and the offline_access permission, to publish in any moment.
You have to think in the big security issue that this situation potentially represents.
Good luck.