0

I would like to get post_ids of user's posts using FQL query.

I have used such a code:

<?php
$fql_query = "SELECT post_id FROM stream WHERE (post_id IN ($posts))";
//I have some particular post_ids in $post. I test whether these posts still exists.
$result = $facebook->api(array(
    'method' => 'fql.query',
    'query' => $fql_query,
)
);
?>

But this code works for me only when the visitor of my website is currently logged in on facebook. I would need to get user's posts (post_id) also when FB user is offline. IS it possible using PHP SDK and FQL, when I have stored user's FB uid and access token in my database?

I am aware, that I need long access token. Should I request it although I have created app on July 2013, so I don't have such deprecated stuff like "offline_access". How will I use the access token, so I will have permission to request user's posts using FQL query?

I am using Facebook PHP SDK (v.3.2.2

EDIT: I have already find solution in another thread: How do i use FQL with php api? and access token creating URL with FQL query, adding access token as argument

Community
  • 1
  • 1
tomas.teicher
  • 913
  • 3
  • 13
  • 26
  • I think you're after long living access tokens, http://stackoverflow.com/questions/10467272/get-long-live-access-token-from-facebook is a Stack Overflow question about it. – Steven V Jul 26 '13 at 13:56
  • As I understand correctly, request for extended long living access is needed only for apps that used offline access, for new app cretaed in july 2013 I don't need to ask for long living token. Am I wrong? How can I use this token in FQL query? – tomas.teicher Jul 26 '13 at 17:51
  • You'll need to hit the end point that is mentioned in the answer and scenario #4 on the Facebook blog post to get a long lived token. Then you can use the `https://graph.facebook.com/fql?q=[query]&access_token=[long lived token]` URL. – Steven V Jul 26 '13 at 19:35

0 Answers0