Reputation: 17803
I'm trying to get the object id of an OpenGraph object with the following FQL:
SELECT url,site,id
FROM object_url
WHERE url IN (
'http://www.MY_OPENGRAPH_OBJECT_URL'
)
I'm getting a result ID which is different than the ID which is returned by https://developers.facebook.com/tools/debug
which I can't query with https://graph.facebook.com/ID (I can using the ID returned from the Facebook debugger).
what is this different ID that I'm getting ? how can I get the correct object ID ? is there an easy way to do so using Facebook Android SDK v3 ?
Upvotes: 3
Views: 9497
Reputation: 3919
Based on the facebook documentation
id - The ID of the Graph object represented by the URL
Using URL :
SELECT url, id, type, site FROM object_url WHERE url = "http://www.mashable.com"
Response :
{
"data": [
{
"url": "http://www.mashable.com",
"id": 435564669831754,
"type": "link",
"site": "www.mashable.com"
}
]
}
Using ID :
SELECT url, id, type, site FROM object_url WHERE id = 435564669831754
Response :
{
"data": [
{
"url": "http://mashable.com/stories/",
"id": 435564669831754,
"type": "link",
"site": "mashable.com"
}
]
}
In this case for mashable URL, the response value "Type : link" and if you u call graph api with the return id, it won't give any values. But If the return type is "Page" then the return ID will works.
But if try using this IMDB url,
SELECT url, id, type, site FROM object_url WHERE url = "http://www.imdb.com/title/tt0117500/"
Response :
{
"data": [
{
"url": "http://www.imdb.com/title/tt0117500/",
"id": 114324145263104,
"type": "page",
"site": "www.imdb.com"
}
]
}
from the documentation -- >
type - The type of object the URL represents (note: 'Page' incorporates any URL with an 'og:type' specified)
i also try www.imdb.com in the
SELECT url, id, type, site FROM object_url WHERE url = "http://www.imdb.com"
Response :
{
"data": [
{
"url": "http://www.imdb.com",
"id": 6903354771,
"type": "link",
"site": "www.imdb.com"
}
]
}
But if you check any url in Fb Debugger tools, in the last section there is a Graph API URL with ID which works fine. I am not sure how facebook is getting this in Debugger.
Upvotes: 3