What is the url to a Facebook open graph post?

15,290

Solution 1

I found out, for a graph id 1099696306_140549259338782 the links is build like this: http://www.facebook.com/1099696306/posts/140549259338782

Solution 2

Honestly, the simplest way I've found to do this is just:

"http://www.facebook.com/" + postId

Where postId is just the straight id of the post (186173001411937), not the userid_postid variant.

Solution 3

with the graph api v2.5 you can use the permalink_url field of the the posts object.

i.e.:

www.facebook.com/v2.5/{pagename}/?fields=posts{permalink_url,message,story,created_time,id}

will return

"posts": {
   "data": [
   {
    "permalink_url": "https://www.facebook.com/etsmtl/posts/10153868925494376",
    "message": "Le Club Cedille organise le prochain Linux-Meetup ce soir à l'ÉTS. Au programme : conférence de James Shubin, ingénieur logiciel sénior chez Red Hat.",
    "created_time": "2016-03-01T15:23:11+0000",
    "id": "8632204375_10153868925494376"
   }, ... }

Solution 4

With regards to a public facing page post take the Id returned from the Facebook Graph API e.g. 12345678_12345678 and append it to facebook.com e.g. https://www.facebook.com/12345678_12345678. The post is also highlighted as you access the page.

Share:
15,290

Related videos on Youtube

corrego
Author by

corrego

Updated on May 16, 2022

Comments

  • corrego
    corrego almost 2 years

    Given a post id returned by a graph search, for example: 186173001411937

    is there a url to link to the post in facebook? The following url does not work: http://www.facebook.com/post.php?id=186173001411937

  • frame
    frame over 9 years
    This won't work for user-posts on pages, the solution by @user580602 however covers this case.
  • Doctor Blue
    Doctor Blue about 8 years
    @corrego you click the checkmark right under the up/down buttons next to the answer.
  • Noitidart
    Noitidart over 7 years
    The user has to be logged in to see this post, is it possible for public to see this post?
  • Noitidart
    Noitidart over 7 years
    The user has to be logged in to see this post, is it possible for public to see this post?
  • Joel
    Joel over 7 years
    This seems to be the best answer; however, as far as I know it is not in the docs. In this bug report: developers.facebook.com/bugs/683573291807160 the Facebook engineer said it will be the change log if it is changed.
  • Joel
    Joel over 7 years
    This does not work in all cases. For me it fails a majority of the time use the permalink_url field instead
  • Joel
    Joel over 7 years
    @corrego this does not work 100% of the time. I have found that the schema for older posts is different. See this bug report: developers.facebook.com/bugs/683573291807160 use the permalink_url field instead.
  • devios1
    devios1 over 7 years
    Yeah I don't really recommend this method anymore. I found it by experimentation and have never seen it documented so it's probably not the best option if you can find a more reliable way.
  • Will Brickner
    Will Brickner over 6 years
    Fantastic, dead-simple solution. Thank you very much. Facebook needs to do a better job documenting their APIs if they expect the world to use them.