There is currently no easy way to check if an auto-submit URL has been flattred by the authenticated user.
The current way is to
- get the thing, which is 1 request
- then get the list of all flattred things of the authenticated user, which is another request and a potentially really big response
- then iterate over the list and match the thing, which is a performance bottle neck
All this makes it unusable for a mobile client like an iOS device. There needs to be a new call. My proposal is:
GET https://api.flattr.com/rest/v2/flattred?url=auto-submit-url
Response:
{
"message": "found",
"description": "The url has been flattred.",
"location": "https://api.flattr.com/rest/v2/things/:id"
}
We had mistakenly not documented the “flattred” parameter on a thing – it should tell you whether the thing is flattred by the authenticated users.
So do a /lookup on the auto-submit URL and check the “flattred” parameter on the thing it gives you.
We’ve added it to the documentation now: http://developers.flattr.net/api/resources/things/#get-a-thing