API Documentation

All services have a {contract} as a parameter. This is the name of the contract. The actual effect of adding contributions and evaluations in terms of tokens and reputation of users will depend on this contract name.

User Collection service at /{contract}/users

Users

GET

Get a list of users

Response: json

POST

values in the body
  • reputation (float) - (optional)
  • tokens (float) - (optional)
  • referrer_id (int) - (optional)

Create a new user.

Response: json

User Resource service at /{contract}/users/{id}

Users

GET

Get the user identified by id

Response: json

Contribution Collection service at /{contract}/contributions

Contributions

GET

values in the querystring
  • contributor_id (int) - (optional)
  • order_by (str) - (default: “-score”)
  • limit (int) - (default: 100)
  • start (int) - (default: 0)

Get a list of contributions.

The parameter ‘order_by’ can take as its values:

  • score order by score
  • -score order descendingly, by score
  • time: the time the contribution was added
  • -time: last-added first

Response: json

POST

values in the body
  • contributor_id (int)

Create a new contribution

Param contributor_id:
 the id of the user that has made the contribution
Returns:information about the new contribution

Response: json

Contribution Resource service at /{contract}/contributions/{id}

Contributions

GET

Get the contribution

Response: json

Evaluation Collection service at /{contract}/evaluations

Evaluations

GET

values in the querystring
  • contribution_id (int) - (optional)
  • evaluator_id (int) - (optional)

Get a list of users

Response: json

POST

values in the body
  • value (int)
  • evaluator_id (int)
  • contribution_id (int)

Create a new evaluation.

Creating an evaluation will update tokens and reputation from the contributor, the evaluator, and previous evaluators.

Param evaluator_id:
 required. The id of the user to that does the evaluation.
Param contribution_id:
 required. The id of the contribution that is being evaluated
Param value:required. This is a number - which values are accepted depends on the contract.
Returns:information about the added evaluation

Response: json

Evaluation Resource service at /{contract}/evaluations/{id}

Evaluations

GET

Get evaluations from the contract

Response: json