Democracy API
The Democracy API enables developers to interact with the Democracy web site programmatically. It's designed to make it possible for anyone to improve Democracy or integrate Democracy into other applications. You can develop a Democracy interface for a mobile phone, build a Democracy widget for your blog, or develop an application that makes it easy to post photos to your feed from your iPhone.
The Democracy API enables developers to interact with the Democracy web site programmatically via simple HTTP requests.
Below on the this page you can find all the different resources accesible with simple http request. We provide two types of resources. The first are Public resources without authentication. Public Resources provide global game playing data and statistics. Public resources are specified as Anonymous. The second type of resource are for the more interesting and privacy sensitive data and is only accesible via oauth.
What is OAuth?
OAuth is an authentication protocol that allows you to authorize a third-party application to interact with Democracy on your behalf without sharing your password.Learn more about OAuth.
If you want to Develop with our API, you need to contact us to get an oauth consumer key to get you implementation/interface working with our api to get user data. Oauth enables users to protect their data. Users control acces to their data. Sites which we AND the user trusts can be given acces but the acces can easily be revoked by the user or us.
Current url resources
- /api/v0/issue/
- /api/v0/users/
- /api/v0/multiply/
- /api/v0/vote/
- /api/v0/issues/new/
- /api/v0/issues/popular/
- /api/v0/issues/controversial/
- /api/v0/tagcloud/
- /api/v0/issues.tags/%22sociale%20zekerheid%22/ tags of multiple words should be between ""
example: http://api.democratiespel.nl//api/v0/issue/1/
Below, the URL in the resources mean you can acces a specific instance for that resource. Resources which return lists of items are paginated , if you want te get the next page add a .page/n to the urls where n is the page number. If n is to big you will get the last result.
As you probably have seen our api is versioned via the url We have made a mobile interface for this data in which you can look for example code , since the source is public on github: git://github.com/spreeker/democracygame.git take a look at the api code and especialy the tests. browse source code
AnonymousIssue:
URL: /api/v0/issue/{id}/
Accepted methods: GET
- method read(id=<optional>):
Issue:
URL: /api/v0/issue/{id}/
Accepted methods: GET, POST
- method read(id=<optional>):
- method create():
-
Create new issue
post parameters:
- title
- body
- direction ( vote of the user )
- url
- source_type
- is_draf
- method update() - inherited
- method delete() - inherited
IssueList:
Resource for Listings of issues in a particular order
- 'new'
- 'popular'
- 'controversial'
URL: None
Accepted methods: GET
- method read():
-
get listing of issue uri's
IssueVotes:
Return votes for issue
URL: /api/v0/issue/{id}/votes/
Accepted methods: GET
- method read(id):
-
Return the different vote counts for an issue
example output:
{"-1": 1, "1":10, "10": 1 ... }
This Means for -1, (against) there is 1 vote , 10 people voted for (1) and 1 person voted blank (10) unconvincing Here are all the different votes directions:
-1. "Against",
- "For",
blank_votes note always higer than 10.
content related problems with issues
- 'Unconvincing',
- 'Not political',
- 'Can't completely agree',
form related problems with issues
- "Needs more work",
- "Badly worded",
- "Duplicate",
- 'Unrelated source',
personal considerations
- 'I need to know more',
- 'Ask me later',
- 'Too personal',
AnonymousMultiply:
URL: /api/v0/multiply/{issue}0/
Accepted methods: GET
- method read(id=<optional>):
-
Read the active multiplies for specific issue or all multiplies in decending paginated order
Multiply:
- If a user has enough game points the user can multiply the value of an issue.
- A multiplied issue will make it more important and gives generate more points.(XXX not yet implemented)
URL: /api/v0/multiply/{issue}0/
Accepted methods: POST, GET
- method read() - inherited
- method create():
-
expects an issue id and optional a downgrade boolean in the POST data
- method update() - inherited
- method delete() - inherited
TagCloud:
URL: None
Accepted methods: GET
- method read():
-
Reads the Tag Cloud for all posts
- method create() - inherited
- method update() - inherited
- method delete() - inherited
Tag:
URL: None
Accepted methods: GET, POST, PUT, DELETE
- method read(tags=<optional>):
-
Read posts. Optional parameters:
tags -- return issues that have the specified tags
- method create():
-
XXX not yet implemented tag an issue
Examples:
Tag input string Resulting tags Notes apple ball cat [apple], [ball], [cat] No commas, so space delimited apple, ball cat [apple], [ball cat] Comma present, so comma delimited "apple, ball" cat dog [apple, ball], [cat], [dog] All commas are quoted, so space delimited "apple, ball", cat dog [apple, ball], [cat dog] Contains an unquoted comma, so comma delimited apple "ball cat" dog [apple], [ball cat], [dog] No commas, so space delimited "apple" "ball dog [apple], [ball], [dog] Unclosed double quote is ignored - method update() - inherited
- method delete() - inherited
AnonymousUser:
URL: /api/v0/user/{id}/
Accepted methods: GET
- method read(id=<optional>):
User:
Get User Details for authenticated user
URL: /api/v0/user/{id}/
Accepted methods: GET
- method read():
- method create() - inherited
- method update() - inherited
- method delete() - inherited
Vote:
Read and Post votes for user.
URL: None
Accepted methods: GET, POST
- method read(id=<optional>):
-
Returns the votes for an user.
- method create():
-
Vote on an Issue
postparameters:
- object_id
- vote
- keep_private (optional)
- method update() - inherited
- method delete() - inherited