Facebook Mentions on a Facebook Page with Graph API - facebook

Has anyone had success with a mention of a FB Page via the Graph API? I'm trying to have one page mention another posting via the Graph API.
I have permissions: "pages_read_engagement" and "pages_manage_posts".
Have tested using FB Pages I'm the admin of with an approved app I'm admin of. Also these Pages are over 6 months old. Also using a real user (mine) and not a test user.
Have posted with #[Page Id], #[Page Name], #[Page ID:Page Name], and #[Page Id:1:Page Name]
Made sure in the Page setting mentions by others is allowed.
Using Facebook SDK version 11.0
and the post always has the mentioned removed.
For example "This is great #[109904187850644]"
posts as "This is great"
The only time mentions show is when the Page mentions itself.
For reference:
https://developers.facebook.com/docs/features-reference/page-mentioning
Related question but using version 2.1 from 7 years ago: Mention Facebook Page in Page API Post
Any thought on the issue? Permissions, way posting, etc?

I have done this recently so I hope I can help you out.
To me it sounds like while you have the required permissions you are missing the actual Page Mentioning Feature. As described on the Page Mentioning Reference the Feature is required to #mention other Pages this is why mentioning the posting Page itself works.
To get authorization to use said feature you have to do an App Review.
Additionally you might want to read up on the differences between Permissions and Features.
From my experience there is no way to test out any functionalities requiring a Feature without doing an App Review because the Graph API will not return any useful data even in development mode while you can test out any permissions without having to do an App Review before.

Related

Sending requests to facebook as a user from a third-party app

I need to initiate searches on facebook marketplace from my application on the user's device. This needs to happen on the user's device, and as the facebook user associated with the user using the application, to avoid getting blocked by facebook. As far as I can understand, this cannot be achieved using facebook's OAuth login and accessing the facebook information that is accessible through it.
Another hypothetical way that comes to mind, is to use the token that the user uses to login into facebook itself, though this one sounds frankly illegal.
tl;dr is there a way to run a search and retrieve the results on facebook marketplace as a user on a user's device?
I found your question on SO, and spent a good bit of time researching this, as I wanted to know the answer myself. Unfortunately, as best as I can tell, this is not possible through any official APIs. It seems like they may have once had something like this, as I found several links to FB API documentation that looked promising. But, the links all rerouted back to the Graph API homepage. I found a couple of references to the big data breaches FB has suffered in the last couple of years as possible reasons why their APIs were retooled and locked down.
I found several Facebook developer posts with questions about a Marketplace API where there were either no answers after months or years, or an official Facebook moderator posting a response like "This is a great idea, we always want to improve, use this form to submit your idea" and so on with no follow up.
I also found at least one SO post within the last 18 months where someone in the comments claimed to be able to post products to FB, but I think this was related to the Business Page Product Catalog, and is not what you're looking for. This is more like if a car dealership or something wants to post a new car for sale that's tied to their FB business page.
The Graph API allows for some decent searching and edge traversal but it is all related to posts, pictures, feeds, etc., and nothing related to the marketplace. Facebook pushes their Marketing APIs so heavily that it was tough to filter through that noise. And, of course, all of marketing apis are geared toward creating ads.
I found some Facebook information around API URLs looking like https://graph.facebook.com/search=terms&type=some_type that was very promising. But the type options seem to be limited to adcountry, adeducationschool, adeducationmajor, adlocale, adworkemployer, adkeyword, adzipcode, adgeolocation, and audienceinterest. And, as I dug deeper, it appears this is related to finding targeting groups for creating targeted posts. Nothing for marketplace.
I think that the answer, unfortunately, is that there are no offical FB APIs at this time that will allow querying search results from the Facebook Marketplace, much less provide enough information to reproduce a listing to display on a 3rd party app.

Facebook publish_actions usage

Im pretty confused with how i need to approach this issue.
I have a website using a 3rd party app which allowed the admin user to login, type in some content which then appeared on his site aswell as publishing to his FB page. All was working until FB changed their procedures last year (believe it was using the Graph API). Unfortunately the 3rd party no longer support this app so i am trying to see if i can resolve.
The application as far as i can tell uses 3 permissions,
manage_pages, publish_actions, publish_pages
Some threads indicate, i need to complete an App Review which once authorised would get everything working as it should. This is in process to save me some time.
Other threads indicate, public_actions is deprecated and cant be used any futher. If i go to FB help pages (https://developers.facebook.com/docs/facebook-login/permissions/#reference-publish_actions) it doesnt list it. In which case i feel this app would therefore no longer work until i fix this AFTER having the app reviewed and accepted?
Can anyone advise which is true and if #2, what do i need to do to get publish_actions to working in this scenario?
Is it possible to have this working in a test enviroment as theres too many variables for me to tackle here i.e. FB state unless the site is https it wont work, app review etc
publish_actions does not exist any more, it has been removed.
Posting to user profiles via API is therefor not possible any more.
To post to a page you are an admin of you don’t need that one to begin with though, the appropriate permission for that is publish_pages, and that still exists.

How does Facebook permissions review work on an existing Live site?

My client has a website that uses FB to retrieve the current user's photos. This had been working for the last few years until recently, which I think is due to FB now requiring permissions to be reviewed by them first.
My client wants to hide the section of the site that uses FB until the issue is resolved, as it makes the site look broken.
My question is how can I submit the FB permissions to be reviewed when the section of the site that uses is hidden? Surely this would be an issue for a lot of people.
In the review description, you can add login data for the review team. Or you use a staging (sub)domain for the review. The Facebook review team is flexible, they will understand. And if you get problems with the review, you can ask in the official dev support group: https://www.facebook.com/groups/fbdevelopers/

Mention Facebook Page in Page API Post

Apologies this is a duplicate post of - Facebook Graph Api - Posting to Fan Page as an Admin
The graph API states verbatim that (https://developers.facebook.com/docs/graph-api/reference/v2.1/page/feed/):
The main body of the post, otherwise called the status message. Either
link or message must be supplied. The message can contain mentions of
Facebook Pages using the following syntax:
#[page-id]
For example the following message would mention the Facebook
Developers page inline:
Test message #[19292868552] tag
If I post to a page (for which I am an admin) with the above syntax, using a page Id for the inline link (for which I am also an admin) and using a facebook application (for which I am a developer) this doesn't appear to work. An example of my call is:
https://graph.facebook.com/v2.1/page-id1/feed?message=Test+message+#[page-id2]+tag
In my case the tag is rendered as it appears above, i.e. no link or mention. So far I have tried:
Different combinations of page-id1 and page-id2.
HTML encoding the #, [ and ] symbols.
Posting as a page or as a user.
Using a different notation #[page-id:page-name]. This is not rendered atall, just becomes a blank space.
I must be missing something obvious if anyone is able to shed any light on this!
That's the documentation for API version 2.1, but your sample call there is unversioned and would thus be using the oldest supported version which is v1.0.
The v1.0 documentation doesn't say anything about that functionality, so it's likely only available in v2.1 or higher
The docs also say your usage of that feature needs to be approved before it can be used by the public, but i think using the correct version should get it working for you for test purposes, provided you're an admin of the App, the Page you're tagging and the Page you're updating
I was stuck on this for quite a while too. A clear answer was given by Igy on the Facebook bug tracker page...
To clarify, for testing this functionality before submitting it for approval you must be posting as a page you admin, tagging a page you admin, and using an app you admin - otherwise the tags are not applied
This is a great answer, but I misunderstood it at first. I was trying to #[page-id] a Facebook page with my test users page. I thought since I was logged into Facebook/developers as an admin with my personal facebook account that the test users I created counted as admin users too and I would be able to #[page-id] other pages they were admins of from their page.
It seems that you can only perform this functionality with the admin account you're signed into on facebook/developers. That account must have a Facebook page they admin, you must use the page access_token and #[page-id] a facebook page they admin from your users page in order for it to work. Once I got over the fact that I can not test this in my development environment with my test users It worked perfectly!
Hope this helps anyone else that might be haveing the same problem.

Syncing comments between Facebook and Wordpress

I'm working on implementing a two-way sync for a website that started as a Facebook fan page years ago and now is going to be run primarily off site.
Right now here's the process I'm using:
Import Posts + Comments from the Graph API. Posts are stored as Wordpress posts, comments are stored as Wordpress comments and some additional data such as Facebook Post ID or Post Author are stored in the post meta.
I've created a second submission form (only admin can submit posts from Wordpress site) that uses the Graph API to post directly to the fan page, then run the importer so that when the post is first entered into the database, it already has it's FB_POST_ID attached.
Comments from Facebook are easily updated and added to Wordpress. FB-Connect allows Facebook users to login and comment on the Wordpress but those comments are not synced with Facebook as I can't attach a user comment to a Facebook post via the Graph API (I can't control other users).
Has anyone run into anything similar or have other ideas for how I could achieve a "two-way" sync? (Quotes as my current setup is technically one-way that mimics two-way. New posts bypass Wordpress then get synced from Facebook).
This question is a bit old, but I actually got here from the official Facebook comments plugin page so I'm answering.
There is a plugin called WP-FB Comments
It's working fine, you can read my experience with it on my blog
(currently trying out Livefyre so you wont see it in action)
I'm working on a similar 2-way sync project. There isn't a way to sync comments (at least none that I can find). The way this has been accomplished is to create a new Facebook application and thus you comment thru the app, not Facebook's native comments, e.g. WPbook. Obviously, it's not ideal.
Wordbooker is another plugin that can accomplish what you're looking for -- when someone posts on Facebook, the comment is imported into Wordpress, and when someone comments on Wordpress, the comment is exported to the Facebook post too. The developer is fairly responsive if you have any issues setting it up.