When I post is published using the application on facebook, there is a small icon below, next to the like button. I want to add application name or some custom text right next to that icon. Below is a screenshot of twitter app that does what I mean. Posts are published using open graph api. Any ideas?
Those are called actions, and you can add them by sending an array of JSON objects as a parameter to your post call.
Example:
actions=[{'name':'#JemalaTony on Twitter', 'link':'http://twitter.com/#!/JemalaTony'}]
Source: Graph API > Post
Related
I am trying to automate Post and Shares in Facebook Page's feed using the Graph API.
For simple posts in feed like text and link I was able to do it with no struggle.
(Based in this: https://developers.facebook.com/docs/graph-api/reference/v2.10/user/feed#publish)
Then I got into making a Share of photo or video. Again not a problem. But I have noticed in Facebook Page itself it is possible to add a Send Message button. Where it even has a label with "Add this button to your post so people can reply directly in Messenger."
Facebook create post in Page
I was looking in the actions sections and other places and I found no way to add it via Graph request.
Currently, I am generating the Post via Graph like this:
POST graph.facebook.com/v2.10/MY_PAGE_ID/photos?access_token=PAGE_TOKEN&caption=MY_TEXT&url=IMAGE_URL
It it possible to add the Send Message button via Graph? Or this is only restricted to Facebook UI?
Thanks for the help!
Use this endpoint /page-id/feed https://developers.facebook.com/docs/graph-api/reference/v3.0/post
call_to_action parameter should be
{"type":"MESSAGE_PAGE","value":{}}
I am trying to publish a feed using graph API using application access token. I am trying to achieve a result similar to the one in the URL below:
Sample Image
I am able to create a feed but following two things I am still unable to figure out:
1) Linking the text in the feed to my application. Currently by clicking on the picture tag or name tag the user is redirected to the external link of the image (used in picture tag)
2) As you will notice in the image there is custom link button next to Comment. One says "Bonus Cash" and other says "Get Simoleons". How to do that?
I am currently using following graph api code. And in order to test it I am currently using Graph Api Explorer.
http://graph.facebook.com/myfbid/feed?&picture=http://www.link.com/linktoimage.jpg&name=Name Tag&caption=Caption Tag&description=Description Tag
If I add link tag to the above code than the type of feed changes from "via Application Name" to "shared a link via Application Name" and that is not what I want to achieve. I want it to say "via Application Name" like it is for other applications like i shared in the image above.
1) Linking the text in the feed to my application. Currently by clicking on the picture tag or name tag the user is redirected to the external link of the image (used in picture tag)
If you want a post to link somewhere – then actually post a link (parameter), and not only a picture.
Edit:
The “posts” in your screenshot might be Open Graph actions published for the user, though. That’s a completely different concept altogether; start reading about it here: https://developers.facebook.com/docs/opengraph/
2) As you will notice in the image there is custom link button next to Comment. One says "Bonus Cash" and other says "Get Simoleons". How to do that?
Use the actions parameter.
Both are explained in the docs: https://developers.facebook.com/docs/reference/api/user/#posts
I have a problem with posting updates to facebook through graph API,when i post something to facebook through graph API, only like and comment are shown for that update in facebook and no share icon, after a little googling i found out that we should use me/links as end point while posting and that's working great i can see share icon for all the link updates i am making now but the problem is how should i handle the case for normal text updates without any links in them how should i post such updates in order to get share icon in facebook,
below is the code i am using for link updates,it posts the update and i can see the share icon in facebook
facebookClient.publish("me/links", String.class , inputStream,
Parameter.with(ACCESS_TOKEN_PARAM, accessToken), Parameter.with(MESSAGE, message),
Parameter.with(PICTURE, imageURL), Parameter.with(LINK, link==null?"":link));
and below is the code i am using to post text updates this code posts the update but with no share icon in facebook.
facebookClient.publish("me/feed", String.class ,
Parameter.with(ACCESS_TOKEN_PARAM, accessToken), Parameter.with(MESSAGE, message));
This is currently not a feature of the Graph API unfortunately. There is a feature request report here that I would recommend you support by voting for it.
As a workaround, you should consider using an Open Graph Action with a user message as opposed to a stream publish call as it will show the Share link and other custom action links can be included too.
I have a Facebook feed that takes me to a landing page when I click on it. I want to be able to add Facebook's like plugin onto that landing page in order to like the feed I came from. This would be the equivalent of clicking like from the feed post itself. I don't know what to use for the data-href property in order to connect the like button to the feed.
I know the feed id and access_token and have tried the following:
https://graph.facebook.com/1608072154_362229823788663&access_token=...
http://www.facebook.com/1608072154/posts/362229823788663
So far I've only been able to like link urls and not the actual feed post.
Is what I'm trying to do even possible? and if so, how do I get the url?
Is what I'm trying to do even possible?
Yes it is possible, but not with the like plugin. I have a production app that pulls in a person's feed from multiple social networks including Facebook. I display a gray star for unliked content and a gold star for liked items. When the user clicks the gray star for a facebook item, I send an HTTP Post to the Graph API with /post_id/likes which likes it. If they click the gold star, then I send an HTTP DELETE to the /post_id/likes which removes it. See: https://developers.facebook.com/docs/reference/api/post/ and the "likes" create/delete section near the bottom.
Is there anyway I can attach a link to a news feed (which was not created by my application)?
Lets say that I would like to create a "send a hug" application. So now when a user browse his news feeds he can see a link at the bottom of each news feed saying "send a hug to this person".
One way to create such an application is to display inside the IFrame of the application all of the user's news feeds through the API (and then I can add whatever I want). However, I would not like the user to enter the application tab each time he wants to send a hug, but to show it to him directly on his facebook's news feed page.
Thanks,
Meir
read this
Name Description Permissions Returns
link The link attached to this post Requires access_token string containing the URL
name The name of the link Requires access_token string