Facebook API - post on page user 'likes' - facebook

using facebooks api... how do you post to a page a user likes on that users behalf... for example I have a user that likes a certain page. They can log into my app and make a post on that pages wall via my app instead of logging into facebook to do it.

If the user grants your app the publish_stream permission then you can post on his behalf on pages he likes (or pages that don't require to like in order to post).
You can try it yourself with the Graph API Explorer, just go there and click the Get Access Token button, then go to Extended Permissions tab, select "publish_stream" and confirm.
Then in the address field put a page you like, let's say southpark/feed and submit, you should see the feed of that page. Now, change the method to the left of the address field to POST and click the Add Field link and write in the name "message", enter a value and submit, you should get an id of the post as a result.

Related

GET List Likes Using Graph API Explorer

I want to search the user's list of likes, to know if he liked my page or not
https://graph.facebook.com/v2.10/me/likes
I also want to know I did not follow my profile or not
https://graph.facebook.com/v2.10/me/???
There is no way to check if someone follows your profile. For getting to know if a user likes your page, you would need to authorize that user with the user_likes permission.
To check if the user likes your page without going through the whole list, you can use the following API endpoint: /me/likes/[page-id] ... if it returns something, the user liked the Page.

check if user likes a page without application perm request

I have a simple tab page, php sdk working and I know I can get the "like" for this specific page from the user signed_request.
This page is a colaboration with another company who also has an FB page. What i´d like to know is if I can get the like status of their page for the current user so I can authorize an action on this tab that is dependant of the user liking both my page and my partner´s.
Is this possible without using an actual app, an access_token and the appropriate perms requested?
e.g. my page is fb.com/Coke and my partner is fb.com/Target
On this specific tab page I want to enable a button only if me (Coke) is liked (which I can get already) and if my partner (Target) is also liked.
I tried the graphAPI (me/likes) and FQL (using the connection table) and both compalin of an unauthorized request.
Short Answer:
No, this will not be possible in a production setting.
Further explanation:
Some users have their list of likes as public. In that case, it would work.
But in order to get likes from a user that has that setting as anything but public (such as myself, only friends of friends can see it), then it requires an app and an access_token that has a user_likes permission.
From the documentation:
Permissions Required:
user_likes permissions if querying the current user.

Facebook get users that like our business page

Our business wants to give a free gift to all the users that like our facebook page. Do you know a way to get the list of emails with all users that liked our page?
Is it possible to obtain that using graph API?
Is there any possibility to offer this functionality to our customers? My problem will reduce to check if one user likes our page.
Radu,
This is not possible at (with FB API) at this time.
See here
You could create tab (with a canvas url) on your facebook page that does the following:
User clicks the tab (or is directed there by some other link)
On the canvas page, use the FB api to check if that user has liked your page. If not, persuade them to do so.
If the user liked the page, show a form where the user can enter his email.
Store the data on your own server.
Hope this helps.
After much research, I used this solution:
I call FB.login to authorize my application and request 'user_likes' permission
check /me/likes/[pageid]
If the response is not null the user likes our page.

Information about user how liked my page/group

After a user clicked on a "like" button of a facebook group or facebook page is it possible to get any addional information about the user beside name and uid?
I know with an app I can request access to a lot of data but I don't want to do that. I also know about facebook statistics.
The question targets more at the point if I publish any information about me if I like something.
The user ID isn't included in the callback on the edge.create event when a user clicks like, so the page doesn't get it then.
If you get a user ID via the user authorising your app you can access their public information at https://graph.facebook.com/ but you'll need them to allow additional permissions to see anything which wouldn't be accessible to a logged-out user.

How to add a "Suggest Our FaceBook Page to A Friend" interface on a website?

With the many programming tools from FaceBook, like FaceBook connect, graph api, etc...
Is there a way to create a form on a website that does this:
I. Website visitor logs into FaceBook (from my website)
II. Form changes. Website visitor is presented with button:
"Invite FaceBook Friends to Like Our FaceBook Page"
III. Form changes to new interface. User is able to view his friends, choose specific friends and suggest FaceBook page to them. User clicks submit button.
IV. FaceBook page is suggested to friends. Data is sent to custom website application/DB to track the FaceBook info of the person who made the suggestion(s).
The whole point of this is that we want to offer a people who refer their FaceBook friends to our FaceBook page some sort of incentive (free product) and we need a way to encourage & track that.
You can refer to this for login with Facebook and knowing whether the user is connected or not: http://developers.facebook.com/docs/guides/web#login
To present the user with an "invite friends" type of interface refer to http://fbrell.com/xfbml/fb:server-fbml-multi-friend-selector
You will notice that the <fb:request-form/> tag takes a content attribute that contains a <fb:req-choice/> tag. This tag contains the url where people accepting the invitation will be directed. You can use this url to refer the person who sent the invitation. By adding a query parameter with it's Facebook id for example.