When you want to “unlike” a built-in like action on an open graph object, you have to send an HTTP DELETE with the id of the like story itself. But that requires either:
- Querying the graph for the ID of the story before deleting it, or
- Stashing the ID that’s returned when you create the like in the first place.
Neither of these are satisfying solutions. It would be nice to be able to do this all in a single request, preferably with nothing more than the URL of the liked object.
Because this modifies the graph, the Graph API has to be used, right? AFAIK, FQL is still read-only.
Half the battle is figuring out a way to use the Graph API to look up the ID of the like story given the URL of the liked object:
Once you have that, you can name it in a batch query, then refer to it from the DELETE request using JSONPath (details here under “Specifying dependencies between operations in the request”):