Back to top

Token Reputation Service

This service stores user reviews of other users/apps and uses those to generate a reputation score.

The generated reputation score and the total number of reviews is sent to the id service.

Reviews

Submit/Update Review

Used to submit a review and a rating for a user.

If a review by the reviewer for the reviewee already exists, the review will be updated.

Submit Review
POST/v1/review/submit

Example URI

POST https://reputation.service.tokenbrowser.com/v1/review/submit
Request
HideShow
Headers
Content-Type: application/json
Token-ID-Address: 0x676f7cb80c9ff6a55e8992d94bac9a3212282c3a
Token-Signature: 0xc39a479a92fe8d626324ff82a33684610ecd6b50714f59542a1ea558220ec6246a9193dd481078417b3b44d55933989587459d3dd50295d4da67d6580ac8646801
Token-Timestamp: 1480077346
Body
{
  "rating": 4,
  "reviewee": "0x056db290f8ba3250ca64a45d16284d04bc6f5fbf",
  "review": "This person is pretty nice"
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "bad_arguments",
      "message": "Bad Arguments"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_address",
      "message": "Invalid User Address"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_reviewee",
      "message": "Cannot review yourself!"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_rating",
      "message": "Invalid Rating"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_review",
      "message": "Invalid Review"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "review_already_exists",
      "message": "A review for that reviewee already exists"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_signature",
      "message": "Invalid Signature"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_timestamp",
      "message": "The difference between the timestamp and the current time is too large"
    }
  ]
}

Update Review
PUT/v1/review/submit

Example URI

PUT https://reputation.service.tokenbrowser.com/v1/review/submit
Request
HideShow
Headers
Content-Type: application/json
Token-ID-Address: 0x676f7cb80c9ff6a55e8992d94bac9a3212282c3a
Token-Signature: 0xc39a479a92fe8d626324ff82a33684610ecd6b50714f59542a1ea558220ec6246a9193dd481078417b3b44d55933989587459d3dd50295d4da67d6580ac8646801
Token-Timestamp: 1480077346
Body
{
  "rating": 3,
  "reviewee": "0x056db290f8ba3250ca64a45d16284d04bc6f5fbf",
  "review": "This person is kinda nice"
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "bad_arguments",
      "message": "Bad Arguments"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_address",
      "message": "Invalid User Address"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_reviewee",
      "message": "Cannot review yourself!"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_rating",
      "message": "Invalid Rating"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_review",
      "message": "Invalid Review"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "no_exiting_review_found",
      "message": "A review for that reviewee was not found to update"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_signature",
      "message": "Invalid Signature"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_timestamp",
      "message": "The difference between the timestamp and the current time is too large"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "missing_arguments",
      "message": "Missing arguments"
    }
  ]
}

Delete Review

Used to delete the review for a given user

Delete Review
POST/v1/review/delete

Example URI

POST https://reputation.service.tokenbrowser.com/v1/review/delete
Request
HideShow
Headers
Content-Type: application/json
Token-ID-Address: 0x676f7cb80c9ff6a55e8992d94bac9a3212282c3a
Token-Signature: 0xc39a479a92fe8d626324ff82a33684610ecd6b50714f59542a1ea558220ec6246a9193dd481078417b3b44d55933989587459d3dd50295d4da67d6580ac8646801
Token-Timestamp: 1480077346
Body
{
  "reviewee": "0x056db290f8ba3250ca64a45d16284d04bc6f5fbf"
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "bad_arguments",
      "message": "Bad Arguments"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_address",
      "message": "Invalid User Address"
    }
  ]
}

Reputation Score

User

Returns the user’s reputation score and number of reviews per rating range.

Get Score
GET/v1/user/

Example URI

GET https://reputation.service.tokenbrowser.com/v1/user/
Response  200
HideShow
Body
{
  "score": 2.6,
  "count": 11,
  "stars": {
    "0": 1,
    "1": 2,
    "2": 3,
    "3": 4,
    "4": 0,
    "5": 1
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "id": "invalid_address",
      "message": "Invalid Address"
    }
  ]
}

Generated by aglio on 19 May 2017