How to construct a permalink for objects returned by Facebook's new Graph API?

Facebook Graph API allows getting Facebook objects like posts, videos etc in JSON from. Here is an example of a post: (taken from the documentation):

         "id": "719323658_129694190395214",
         "from": {
            "name": "Rabia Yalcinkaya",
            "id": "719323658"
         "message": "COK MUHTESEM!!!",
         "picture": "",
         "link": "",
         "source": "",
         "name": "Watermelon carving",
         "caption": "",
         "description": "Me carving a watermelon.",
         "icon": "",
         "type": "video",
         "created_time": "2010-06-23T10:58:17+0000",
         "updated_time": "2010-06-23T10:58:17+0000",
         "likes": 1

How does one construct a url which allows you to link back to the original video (or other types) on Bret's wall on Facebook? something in the form of<USER_ID>/video/<VIDEO_ID>

Thanks, Boaz


in the actions field there is the link field (for each available action) which happens to contain the permalink to the given post. However be sure to inspect this before relying on it - it might change. I've only used it with "comment" and "like".

Apart from that you'd have to construct it manually. For users that have their username set (i.e. their profile is accessible via, it works with:

For everything else:


Note that the POSTID is in the form USERID_POSTID, so you'd have to strip the first part.

Need Your Help

Subversion rebase?

svn rebase svn-reintegrate

I find this way easier to merge branches and less conflicts: