2016-11-10 11 views
1

私は、Graph APIからの応答をJSON Responseの各反応の合計数で取得しようとしています。例えばFacebook Reactions total count

{ 
    "data": { 
    "like": 1242, 
    "wow": 674, 
    "sad": 2500 
    ...... 
    } 
} 

は現在、私は、以下の "{} postID /反応/フィールド=タイプ?" しかし、これは、それぞれのカウントを返していませんしています。 Facebook APIの最近のアップデートでは誰にもこれに対する解決策がありますか?

https://developers.facebook.com/tools/explorer/

https://developers.facebook.com/docs/graph-api/reference/post/reactions

答えて

1

私はそれを考え出したが、JSON応答が同じ形式ではありませんが、それは私のために動作します。

?fields=reactions.type(LIKE).summary(total_count).limit(0).as(like),reactions.type(LOVE).summary(total_count).limit(0).as(love),reactions.type(WOW).summary(total_count).limit(0).as(wow),reactions.type(HAHA).summary(total_count).limit(0).as(haha),reactions.type(SAD).summary(total_count).limit(0).as(sad),reactions.type(ANGRY).summary(total_count).limit(0).as(angry)