Facebook:获取OpenGraphStory的Reactions接口调用错误及正确方法
Got it, let's break down why you're hitting that (#100) error and how to fix it.
Why the Error Happens
The error message spells it out clearly—you're trying to access the reactions field on an OpenGraphAction node, which doesn't support that endpoint. Here's the key context:
- The
open_graph_storyyou're pulling from page ratings is actually an OpenGraphAction (a user's action like "rated X" or "shared Y"). - Reactions aren't stored on the action itself—they're attached to the Open Graph Object that the action points to (the actual content the user interacted with).
Correct Steps to Get Reactions
Follow these two steps to retrieve the reactions properly:
Fetch the Open Graph Object ID from the OpenGraphAction
Modify your initialratingsAPI call to include the linked object's ID instead of just the action's ID. Use this field parameter:{page-id}/ratings?fields=open_graph_story{object{id}}This will return the ID of the actual Open Graph Object that the story/action is associated with.
Call Reactions on the Object ID
Once you have the Open Graph Object ID, use it in the reactions endpoint:{open-graph-object-id}/reactionsThis will work because the
reactionsfield is fully supported for Open Graph Object nodes.
Quick Example
If your modified API response looks like this:
{ "data": [ { "open_graph_story": { "object": { "id": "1234567890" } } } ] }
You'd then call 1234567890/reactions to fetch all reactions for that content.
内容的提问来源于stack exchange,提问作者Mat

