Facebook: How to get an object id from a URL

I am trying to implement Facebook api comments (see this question if you have time), I need to get the object identifier, all I have is the URL of the object, If I use Facebook debugging, they will give me something- something like this: Graph API: http://graph.facebook.com/451006711598242

I believe 451006711598242 is my id. I tried to make paired calls: https://graph.facebook.com/comments?id= {myUrl}, but it does not work. Any ideas what I need to do?

+4
source share
1 answer

Try returning the object_id object:

 $object_url = 'http://google.com'; $url = 'SELECT url, id, type, site FROM object_url WHERE url = "'.$object_url.'"'; $fql_query_url = 'https://graph.facebook.com/fql?q='.urlencode($url); $fql_query_result = file_get_contents($fql_query_url); $fql_query_obj = json_decode($fql_query_result, true); $object_id = $fql_query_obj['data'][0]['id']; 
0
source

Source: https://habr.com/ru/post/1488073/


All Articles