I need to set a page to expire. I can see a property called "expires" for the DAM assets, but there is no such property for pages. How can I set it on a page?
Also, I need to send the notification to the administrators when the page is going to expire, let's say 5 days before the page is set to expire. How can we achieve this?
You can do this by using a feature called 'Manage Publication' in AEM. It allows you to unpublish a page immediately or schedule it for later. This is basically a scheduled job in the workflow which will ubpublish (deactivate/delete) your page from the publisher on a given time.
AEM 6.1 specific document can be found here.
Related
Premise:
After solving the mystery of the permanent token access, I have been able to post on my Readerly.Ink page from my app.
Problem:
My app, however, is supposed to post on multiple pages, depending on the language of the content. Hence, I today created the other pages (Readerly - Italiano, Readerly - English etc) but I cannot see them through the app!
Even if i GET /me/accounts, the original/first Readerly.Ink page is all I see. I also tried: /new-page-id?fields=access_token&access_token=your-user-access-token (as per instructions of the Pages API) - but I get an error! :-(
Question:
How do I add the new pages to the app?
Or do I need to create a different app for each page?
As far as I can tell, I created the new pages exactly as I created the first one (I'm the admin) and I added them all to my business account.
Please advise. Thanks
Or do I need to create a different app for each page?
No, you don't need to do that. An app is still able to manage multiple pages.
It used to be that you just granted an app access to manage all pages you have admin access to. But since that is obviously a bit broad and risky, Facebook has since changed things - users can specify which of their pages they actually want an app to have access to.
You get asked for that on the login dialog, when the permission is initially requested - but that list does not auto-update later to include any pages you created after that happened.
Currently, there does not seem to be any more practical procedure to get the new pages included, than removing the granted permission, and then asking for it again - upon which the user will be asked to chose which of their current set of pages they want to grant access to again.
For a quick fix, you can use Graph API Explorer - use the "get token" functionality, remove the granted manage_pages permission, and then ask for it again.
For a public facing app that has other people manage their own pages, probably such a step should be implemented within the app - remove the permission via API when necessary, then send them through the login flow again. (Might need to use the reauthenticate parameter at this point.)
I want to make an events calendar using Facebook API. I have an array with page URLs I want to scan and take its events. The problem is, I am using an App Access Token and I can't obtain events from pages with restricted age (alcohol pages etc.). Is there any way I can obtain those events?
There is no way to access restricted Pages with an App Token. You have to use a User Token of a User who can access the Page, or a Page Token of that Page. There is no other way, or the restriction would be pointless.
Go to the advanced settings of your applications page on developers.facebook.com. e.g. for me it would be https://developers.facebook.com/apps//settings/advanced/. And set app restrictions for 'references alchohol' to yes, similar for age.
Screenshot of setting attached
I've been searching the net on how to setup the Facebook webhooks to check a particular Facebook page (I'm a content editor of) for certain updates.
I read the docs many times about setting up the callback URL whenever a particular "event" happens on that Facebook page, but I never read a straight answer on how to tell which page I want to monitor in.
I was pointed to the {app-id}/subscriptions endpoint, but it doesn't seem to be the one I need.
Could someone provide an idea on how this works?
You need to make a request to /{page_id}/subscribed_apps to create a subscription for updates from a page.
This call needs a page access token, so you need to request manage_pages permission first from an admin of the page. (Not sure if “content editor” role is sufficient for that.)
When fetching page conversations, I receive a link field. This link field is an absolute path, without the server, e.g. /PAGE-12312/manager/messages/?mercurythreadid=....
Depending on whether a page is managed via the "Facebook Business Manager" or not, that link should be either opened via facebook.com or business.facebook.com.
How can I find out whether the FB page is managed via the business manager, i.e. how can I know how to properly construct the link back to facebook?
Linking to a private messages on a page managed via the business manager does not word, i.e. opening facebook.com/PAGE-12312/manager/messages/?mercurythreadid=.... leads to an error.
The business field on the /{page-id} node in graph api is the ID of the business that owns the page in Business Manager, if any. It's only available with a page admin token.
You have to ask explicitly for the field in the api-request:
/{page-id}/?fields=business
The way we solved worked this around is by realizing that you can always link into the Business Manager, even when the page doesn't have it activated.
I would like to get notified programatically (using the callback URL) that any one of 100 Facebook Pages (or a User, but less important) has posted a new post to their Timeline/Feed or edited some of the Page details such as opening times for example.
My understanding from reading this documentation https://developers.facebook.com/docs/graph-api/real-time-updates/v2.3 is that I can "Subscribe" to changes programatically for multiple Objects (i.e. 50 Pages and 100 Users) using my App providing i have Permissions to do so from the User (I only want publicly available Page data).
I don't see the value in this "Subscribe" functionality if it does not do what the above requirements describes
Update: I have edited the question slightly as the initial question was found to be a bug in the Facebook user documentation as discovered by the comment below.
https://developers.facebook.com/docs/apps/changelog#v2_2_new_features
There is a new endpoint called subscribed_apps - you can connect an App to a Page without adding it as Tab now, so it does not show up for the users. The rest is the same, you still need /subscriptions to add a subscription (with callback and object) - but there is a bug in the docs, it´s not removed in v2.3: https://developers.facebook.com/bugs/799294656844725/
Btw, of course you can´t subscribe to a Page you don´t own. You have to be Moderator at least.