How do you post a like link without using Like Button plugin - facebook-like

How do you post a like link without using Like Button plugin? and not shared a link and then like it.
I need a like posted after user confirm she want to post it to fb or not.
Is there a way?or I should shared a link and the like it?

What you're asking for is very simple. You can use the graph API to post to a user's feed the link. The API returns the ID of the post you just made. Then you can call the graph API to like that ID.

Related

Facebook graph api post status

I'm trying to post on my own feed , but im not able to ,as this page says we cant on feed directly but by using 'share' link
can someone please explain? how to post on feed using simple curl command?
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#login-4-24
It is no longer possible to post to a user profile with the API (or with curl), the docs are very clear about that. You can only use the Share Dialog.

Facebook API: How to get all data related to a post?

I'm trying to get all data related to a particular post like comments, likes, view count, etc in one API call. I can get likes by {post-id}/likes and comments by /{post-id}/comments.
How do I get all this detail in one API call?
Try
/{post_id}?fields=id,message,likes,comments
See
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#fields

how to read facebook page feed via app access token?

How could I get the facebook page feed, when the user isnot loged in.
I could get app access token,after that how I need to fetch data via graph api.
Please provide a sample and could I test that in facebook explore tool.?
All you really need to do is make a request to:
https://graph.facebook.com/v2.0/PAGE_ID?access_token=APP_ACCESS_TOKEN
So, for example, to get CocaCola's page feed, the request would look something like this:
https://graph.facebook.com/v2.0/40796308305/feed
The endpoint you're dealing with here is /{page_id}/feed. The relevant documentation can be found here - https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed.
For your convenience, here is a link directly to the API explorer with the relevant query:
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=40796308305%2Ffeed&version=v2.0

how do i programmatically create folder for application to upload content in it using BOX rest api

I want to support box cloud facility my blackberry 10 app,for this i'm using box rest api to implement this functionality. so using box rest oauth2.0 i able to get authorizedcode and then accessToken and RefreshToken but still not able to create a folder of my app to upload content to user's box account. So please suggest me how do i implement this.
Thanks,
Ankur
You should probably include a little of your code. Otherwise this question won't really help anyone else.
If you've made it through the authentication stage, then you're 99% of the way there. You can create a folder by doing a POST to https://api.box.com/folders with a JSON payload that provides the name and parent_id of the folder you want to create and the location you want to create it in.
From your code above, it looks like you're trying to send a POST request to https://api.box.com/2.0/folders/0
Folder creation requests should actually be POST'd to:
https://api.box.com/2.0/folders
Note, there isn't a 0 there. I understand that it's fairly intuitive to POST to the ID of the parent folder you desire, but this is how we handle this.
Your request body must indicate the parent folder like this:
var postData ={"name":"New Folder", "parent":{"id": "0"}};
Hope that helps!

Re-sharing posts from an app

When I am posting to my wall directly, then my friends have an option to "re-share" the post by clicking on "Share" link (last one in the list of actions: Like * Comment * Share). However, when I post from an application, there is no "Share" link and only Like and Comment actions are available.
Is there a way to change application or application preferences to enable direct re-sharing for posts from applications?
You can post a "Link" to User's wall with a "link"-field to the Original post like "http://www.facebook.com/{{$fb_id}}" and you can add a "message" to that as well.
UPD: for reSharing a "Picture" you either "generate" a link like "http://www.facebook.com/photo.php?fbid={{$fb_id}}" or request Picture via GraphAPI and use it's "link" field. this is valid for other FB-Graph-Types.
Here is how it is done In Graph API do this..
post me/feed
message : YOUR_MESSAGE
link : link to share
actions : {name: "share", link: "linktoshare"}
Refer these
https://developers.facebook.com/docs/reference/api/user/#posts
http://developers.facebook.com/docs/guides/mobile/#android