페이스 북 php sdk를 사용하여 다른 사람이 사용자의 벽에 작성한 모든 게시물에 대한 주석 목록을 얻으려고합니다. 다음과 같이 나는 배치 API 요청에 FQL을 사용하고 있습니다 : 종속 fql 쿼리의 in 절에 대한 jsonpath 요소를 인용/이스케이프 처리합니다.
$getStream = urlencode("method/fql.query?query=SELECT post_id, actor_id, target_id, source_id,viewer_id, message FROM stream WHERE app_id= '' and message != '' and source_id=$fbprofileId and target_id=$fbprofileId and is_hidden=0 limit 100");
$getComments = urlencode("method/fql.query?query=select object_id, post_id, fromid, time, text, id, likes, comments, user_likes, is_private from comment where post_id in({result=get-stream:$.*.post_id})");
$queries = array(
array('method' => 'POST',
'omit_response_on_success' => false,
'name' => 'get-stream',
'relative_url' => $getStream),
array('method' => 'POST',
'omit_response_on_success' => false,
'name' => 'get-comments',
'relative_url' => $getComments)
);
return $this->fbApi->api('?batch='.json_encode($queries), 'POST');
I FB에서 다음과 같은 응답을 얻을 :
{"error_code":601,"error_msg":"Parser error: unexpected '_1831955838114' at position 63.","request_args":[{"key":"method","value":"fql_query"},{"key":"format","value":"json"},{"key":"_fb_batch_child_request","value":"1"},{"key":"query","value":"select user_id, object_id from like where post_id in(1216940586_1831955838114,1216940586_1831891396503,1216940586_1831423824814,1216940586_1828915522108,1216940586_1822006149378,1216940586_1820687356409,1216940586_1813971228510,1216940586_1809392594047,1216940586_1795412004541,1216940586_1795177518679)"},{"key":"_fb_url","value":"method\/fql.query"},{"key":"access_token","value":"AAAC02IZB..."}]}
post_ids 인용 사실, 사용할 필요가 분명히 보인다 동일한 쿼리 fb 그래프 api explorer with IN 절에서 인용 된 post_ids를 사용하면 결과가 잘됩니다.
** post_ids는 문자열 (int가 아님)이므로 관련 배치 API FQL 쿼리의 컨텍스트에서 FQL IN 절에 적절한 인수를 지정하려면 어떻게해야합니까? **
그것은 조금 늦게, 가장 가능성이 있지만,이 대안으로 FQL API를 올바르게 유형을 처리 일괄 쿼리를 지원하는 것
감사해야한다 -이 FQL 기능을 인식하지 않았다 - 내가해볼 께! –