User Voting API

This API is intended for services which allows saving votes of users regarding bills.

This API allows users to report their support/opposition to bills (approved, ongoing or dismissed)

After voting, we can calculate the correlation between each MK’s voting and the specific user’s votes. Users may query the DB for the list of MKs, ordered by correlation score. Querying for parties is possible as well.

Other options the API provides is to find the bills with most votes in a previous time frame (day/week/month).

API contents

All users are identified by a common "user key", which consists of a domain and a user id:
- Domain: who identified this user. Current options: "fb", "oknesset"
- User id: string containing unique id in the specific domain

The user key should have the format "domain:user_id".

uservote/vote
POST

store a new vote of a user for a specific bill.

parameters:
- user_key: user key
- bill: integer, bill id in open-knesset’s db
- support: float, 1.0 for full support and -1.0 for full disapproval

Re-posting will modify the user’s vote.
Re-posting with support == 0 will actually remove the user’s vote.

uservote/user/ user-key /votes/

get user’s votes.

returns a list of bill ids and support values/

uservote/user/ user-key /votes/ bill-id

get a user’s vote for a specific `bill

returns the support value

uservote/user/ user-key /mks

get the user’s correlation score with all mks

uservote/user/ user-key /parties

get the user’s correlation score with all parties

uservote/bill/ bill-id

gets the voting stats for this bill/

returns:
- the number of positive votes
- the number of negative votes
- average support value
- user keys of users who voted for this bill (positive support score)
- user keys of users who voted against this bill (negative support score)

uservote/hits/ days

gets the most popular bills which were voted on in the last days days.