I want to post in behalf of the user a message that contains a link to another Facebook page. Something that is easily achievable through Facebook interface by choosing an autocompleted name of the page:
<img alt="example of the embedded link" class="b-lazy" data-src="https://i.stack.imgur.com/X1KRq.png" data-original="https://i.stack.imgur.com/X1KRq.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />
I use Ruby with the koala gem. I tried to do something like this:
graph = Koala::Facebook::API.new(access_token) graph.put_object(page_id, "feed", message: "Embedded @[23497828950:National Geographic] link")
but it doesn't convert the link. I could post a full URL but that doesn't look as nice.
Is there a way to achieve the same thing as on Facebook (a linked page title) through the Graph API?Answer1:
This can only be accomplished using the <a href="https://developers.facebook.com/docs/opengraph/using-actions/#pages" rel="nofollow"><strong>Open Graph Actions</strong></a>.
POST /me/cookbook:eat? recipe=http://www.example.com/recipes/pizza/& message=You should really try this recipe from @& access_token=VALID_ACCESS_TOKEN
If you are not aware of Open Graph API, you can start from here: <a href="https://developers.facebook.com/docs/opengraph/" rel="nofollow">https://developers.facebook.com/docs/opengraph/</a>
Just follow the steps mentioned in the tutorial, quite easy to integrate and make your stories more beautiful.