Facebook: identify object id and type by url
===

I want to get the id and type of a Facebook object based on its URL.

My goal is to identify if a certain URL is a Facebook Event (for example https://www.facebook.com/events/258629027581347).

So if I had the object-id of that object I could do the following FQL query and know that if I get a result the object is an Event:

    select eid from event where eid = 258629027581347

The problem is getting the object-id based only on the URL. I do **not** want to parse the id from the URL because there is no guarantee that the format of the URL will remain the same in the future. I want to find a way to do it through one of Facebook's API's.

After searching for a while, I found the following suggestions for how to do this, but unfortunately none of them work:

1. FQL query from the `object_url` table - the query yields no results:

    `SELECT url, id, type, site FROM object_url WHERE url = "https://www.facebook.com/events/258629027581347"`

2. Use the graph api:

    `https://graph.facebook.com/https://www.facebook.com/events/258629027581347`

 This returns a JSON object containing only the URL - no id.

3. Use the graph api with `?ids=` like this:

    `https://graph.facebook.com/?ids=https://www.facebook.com/events/258629027581347`

 This returns the following JSON, also no id:

    `{
      "https://www.facebook.com/events/258629027581347": {
        "id": "https://www.facebook.com/events/258629027581347", 
        "metadata": {
          "connections": {
            "comments": "https://graph.facebook.com/https://www.facebook.com/events/258629027581347/comments?access_token=AAACEdEose0cBADzSuuyJWohIwkXuvQGJUsIlSJz04J4nzKqqQXTvGiPXf4YDBPuh0rdyXgSWnWcJpN3X3GaATVLjG6UmZBiHKmcxCWwZDZD"
          }, 
          "type": "link_stat"
        }
      }
    }`

What am I missing here?

Thanks!