| Field | Type | Permission | Description |
|---|---|---|---|
| type | string | Object type, set to flattr. | |
| thing | hash | Contains a thing object. | |
| owner | hash | Contains either a user object or a mini user object (default). | |
| created_at | string | Format is unixtime. |
GET https://api.flattr.com/rest/v2/users/:username/flattrs
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Current: 1
X-RateLimit-Reset: 1342521939
[
{
"type": "flattr",
"thing": {
"type": "thing",
"resource": "https://api.flattr.com/rest/v2/things/313733",
"link": "https://flattr.com/thing/313733",
"id": 313733,
"url": "https://flattr.com/profile/gnuproject",
"title": "GNU's not Unix!",
"image": "https://flattr.com/thing/image/3/1/3/7/3/3/medium.png",
"flattrs": 3,
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/gnuproject",
"link": "https://flattr.com/user/gnuproject",
"username": "gnuproject"
}
},
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/qzio",
"link": "https://flattr.com/user/qzio",
"username": "qzio"
},
"created_at": 1316697578
}
]
If the response header is 200 OK but the response is empty there is two possible reasons. One is that the user have choosen to hide what he/she flattrs. The other is because that user haven't flattred anything yet.
not_found (404 Not Found) - The requested user could not be foundGET https://api.flattr.com/rest/v2/user/flattrs
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Current: 1
X-RateLimit-Reset: 1342521939
[
{
"type": "flattr",
"thing": {
"type": "thing",
"resource": "https://api.flattr.com/rest/v2/things/313733",
"link": "https://flattr.com/thing/313733",
"id": 313733,
"url": "https://flattr.com/profile/gnuproject",
"title": "GNU's not Unix!",
"image": "https://flattr.com/thing/image/3/1/3/7/3/3/medium.png",
"flattrs": 3,
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/gnuproject",
"link": "https://flattr.com/user/gnuproject",
"username": "gnuproject"
}
},
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/qzio",
"link": "https://flattr.com/user/qzio",
"username": "qzio"
},
"created_at": 1316697578
}
]
unauthorized (401 Unauthorized) - You are unauthorized to access the resource (no token?)GET https://api.flattr.com/rest/v2/things/:id/flattrs
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Current: 1
X-RateLimit-Reset: 1342521939
[
{
"type": "flattr",
"thing": {
"type": "thing",
"resource": "https://api.flattr.com/rest/v2/things/313733",
"link": "https://flattr.com/thing/313733",
"id": 313733,
"url": "https://flattr.com/profile/gnuproject",
"title": "GNU's not Unix!",
"image": "https://flattr.com/thing/image/3/1/3/7/3/3/medium.png",
"flattrs": 3,
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/gnuproject",
"link": "https://flattr.com/user/gnuproject",
"username": "gnuproject"
}
},
"owner": {
"type": "user",
"resource": "https://api.flattr.com/rest/v2/users/qzio",
"link": "https://flattr.com/user/qzio",
"username": "qzio"
},
"created_at": 1316697578
}
]
unauthorized (401 Unauthorized) - You are unauthorized to access the resource (no token?)Scope required: flattr
POST https://api.flattr.com/rest/v2/things/:id/flattr
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Current: 1
X-RateLimit-Reset: 1342521939
{
"message": "ok",
"description": "Thing was successfully flattred",
"thing": {
"type": "thing",
"resource": "https://api.flattr.com/rest/v2/things/423405",
"link": "https://flattr.com/thing/423405",
"id": 423405,
"flattrs": 3,
"url": "http://blog.flattr.net/2011/10/api-v2-beta-out-whats-changed/",
"title": "API v2 beta out - what's changed?",
"image": "https://flattr.com/thing/image/4/2/3/4/0/5/medium.png"
}
}
flattr_once (HTTP 403) - The current user have already flattred
the thingflattr_owner (HTTP 403) - User is the owner of the thingno_means (HTTP 401) - Current user don't have enough means to flattrnot_found (HTTP 404) - Thing does not existinvalid_request (HTTP 400) - Request is not validScope required: flattr
The flattr resource flattrs flattrable URL:s. Flattrable URL:s are those already registered with Flattr, those that we support discovering ownership data of and those contained within an auto-submit URL together with the metadata needed to register a new thing.
We support discovering ownership data from these URL:s.
An auto-submit URL contains all necessary metadata for a thing. If the URL in an auto-submit URL isn't registered on Flattr, then it will be created before being then flattred. Auto-submit URL:s are recommended for use in eg. feeds and looks like this: http://flattr.com/submit/auto?url=http%3A%2F%2Fblog.flattr.net%2F2011%2F10%2Fapi-v2-beta-out-whats-changed%2F&user_id=flattr.
POST https://api.flattr.com/rest/v2/flattr
{
"url": "http://flattr.com/submit/auto?url=http%3A%2F%2Fblog.flattr.net%2F2011%2F10%2Fapi-v2-beta-out-whats-changed%2F&user_id=flattr"
}
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Current: 1
X-RateLimit-Reset: 1342521939
{
"message": "ok",
"description": "Thing was successfully flattred",
"thing": {
"type": "thing",
"resource": "https://api.flattr.com/rest/v2/things/423405",
"link": "https://flattr.com/thing/423405",
"id": 423405,
"flattrs": 3,
"url": "http://blog.flattr.net/2011/10/api-v2-beta-out-whats-changed/",
"title": "API v2 beta out - what's changed?",
"image": "https://flattr.com/thing/image/4/2/3/4/0/5/medium.png"
}
}
flattr_once (HTTP 403) - The current user have already flattred
the thingflattr_owner (HTTP 403) - User is the owner of the thingno_means (HTTP 401) - Current user don't have enough means to flattrnot_found (HTTP 404) - Thing does not existinvalid_request (HTTP 400) - Request is not valid