이 개체에 좋아요를 누른 사용자의 리스트를 반환합니다. 페이지 또는 사용자 개체에 누른 좋아요를 읽을 경우 이 엔드포인트는 해당 페이지 또는 사용자가 좋아요를 누른 페이지의 리스트를 반환합니다.
개체의 likes 필드를 사용하여 좋아요 개수를 가져옵니다.
좋아요를 가져올 경우 가능하면 /object/reactions 엔드포인트를 사용하는 것이 좋습니다.
다음의 개체 /likes 엔드포인트가 새 페이지 환경에 지원됩니다.
|
summary 매개변수가 포함된 total_count를 사용하는 집계된 합계만 게시물 좋아요에 제공됩니다.like 공감 수에는 '좋아요'와 '힘내요' 공감이 포함됩니다.
total_count는 좋아요의 대략적인 개수를 나타내지만 반환된 실제 개수는 공개 범위 설정에 따라 달라질 수 있습니다.GET /{group-post-id}/likes와 GET /{post-id}/likes 엔드포인트는 v8.0 이상에서 사용 중단되었고 2020년 11월 2일부터 모든 버전에서 사용 중단됩니다. | 속성 이름 | 설명 | 유형 |
|---|---|---|
| 개체의 사용자 및 페이지 좋아요 합계. 이 필드가 반환되려면 요청에 |
|
curl -i -X GET "https://graph.facebook.com/{object-id}
?fields=likes.summary(true)
&access_token={access-token}" {
"likes": {
"data": [
{
"name": "Bill the Cat",
"id": "155111347875779",
"created_time": "2017-06-18T18:21:04+0000"
},
{
"name": "Calvin and Hobbes",
"id": "257573197608192",
"created_time": "2017-06-18T18:21:02+0000"
},
{
"name": "Berkeley Breathed's Bloom County",
"id": "108793262484769",
"created_time": "2017-06-18T18:20:58+0000"
}
],
"paging": {
"cursors": {
"before": "Nzc0Njg0MTQ3OAZDZD",
"after": "NTcxODc1ODk2NgZDZD"
},
"next": "https://graph.facebook.com/vX.X/me/likes?access_token=user-access-token&pretty=0&summary=true&limit=25&after=NTcxODc1ODk2NgZDZD"
},
"summary": {
"total_count": 136
}
},
"id": "user-id"
}개체에 좋아요를 누릅니다.
다음의 개체 /likes 엔드포인트가 새 페이지 환경에 지원됩니다.
|
POST /v26.0/{object-id}/likes HTTP/1.1
Host: graph.facebook.com/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{object-id}/likes',
array (),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result *//* make the API call */
FB.api(
"/{object-id}/likes",
"POST",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{object-id}/likes",
null,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{object-id}/likes"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];CREATE_CONTENT 작업을 수행할 수 있는 사용자가 요청한 페이지 액세스 토큰pages_manage_engagement 권한좋아요를 추가하는 데 필요한 필드가 없습니다.
성공할 경우 앱은 다음과 같은 응답을 받습니다.
{
"success": true
}이 엔드포인트에서는 이 작업을 수행할 수 없습니다.
이 엔드포인트를 사용하여 페이지 개체에서 좋아요를 삭제합니다.
DELETE /v26.0/{object-id}/likes HTTP/1.1
Host: graph.facebook.com/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->delete(
'/{object-id}/likes',
array (),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result *//* make the API call */
FB.api(
"/{object-id}/likes",
"DELETE",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{object-id}/likes",
null,
HttpMethod.DELETE,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{object-id}/likes"
parameters:params
HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];MODERATE 작업을 수행할 수 있는 사용자가 요청한 페이지 액세스 토큰pages_manage_engagement 권한likes만 삭제할 수 있습니다.이 엔드포인트에 대한 필드가 없습니다.
성공할 경우 앱은 다음과 같은 응답을 받습니다.
{
"success": true
}