Votes

Get votes for an activity

get
Query parameters
typestring · enumRequiredPossible values:
activityIdnumberRequired
isUpvotebooleanOptional
orderBystring · enumOptionalDefault: updatedAtPossible values:
orderDirectionstring · enumOptionalDefault: descPossible values:
limitinteger · max: 50OptionalDefault: 50
offsetnumberOptionalDefault: 0
Responses
200
Successful response
application/json
get
GET /api/v2/votes HTTP/1.1
Host: api.ethos.network
Accept: */*
{
  "values": [
    {
      "isUpvote": true,
      "isArchived": true,
      "voter": 1,
      "targetContract": "text",
      "targetId": 1,
      "createdAt": 1,
      "weight": 1,
      "user": {
        "id": 1,
        "profileId": 1,
        "displayName": "text",
        "username": "text",
        "avatarUrl": "https://example.com",
        "description": "text",
        "score": 1,
        "status": "ACTIVE",
        "userkeys": [
          "text"
        ],
        "xpTotal": 1,
        "xpStreakDays": 1,
        "stats": {
          "review": {
            "received": {
              "negative": 1,
              "neutral": 1,
              "positive": 1
            }
          },
          "vouch": {
            "given": {
              "amountWeiTotal": 1,
              "count": 1
            },
            "received": {
              "amountWeiTotal": 1,
              "count": 1
            }
          }
        }
      }
    }
  ],
  "total": 1,
  "limit": 1,
  "offset": 1
}

Get aggregated vote stats for a single activity

get
Query parameters
typestring · enumRequiredPossible values:
activityIdnumberRequired
includeArchivedbooleanOptional
Responses
200
Successful response
application/json
get
GET /api/v2/votes/stats HTTP/1.1
Host: api.ethos.network
Accept: */*
{
  "userVote": {
    "isUpvote": true,
    "isArchived": true,
    "voter": 1,
    "targetContract": "text",
    "targetId": 1,
    "createdAt": 1,
    "weight": 1,
    "user": {
      "id": 1,
      "profileId": 1,
      "displayName": "text",
      "username": "text",
      "avatarUrl": "https://example.com",
      "description": "text",
      "score": 1,
      "status": "ACTIVE",
      "userkeys": [
        "text"
      ],
      "xpTotal": 1,
      "xpStreakDays": 1,
      "stats": {
        "review": {
          "received": {
            "negative": 1,
            "neutral": 1,
            "positive": 1
          }
        },
        "vouch": {
          "given": {
            "amountWeiTotal": 1,
            "count": 1
          },
          "received": {
            "amountWeiTotal": 1,
            "count": 1
          }
        }
      }
    }
  },
  "counts": {
    "upvotes": 1,
    "downvotes": 1
  }
}

Get aggregated vote stats for multiple activities

post
Body
attestationnumber[]Optional
discussionnumber[]Optional
reviewnumber[]Optional
slashnumber[]Optional
vouchnumber[]Optional
projectnumber[]Optional
includeArchivedbooleanOptional
Responses
200
Successful response
application/json
post
POST /api/v2/votes/stats HTTP/1.1
Host: api.ethos.network
Content-Type: application/json
Accept: */*
Content-Length: 110

{
  "attestation": [
    1
  ],
  "discussion": [
    1
  ],
  "review": [
    1
  ],
  "slash": [
    1
  ],
  "vouch": [
    1
  ],
  "project": [
    1
  ],
  "includeArchived": true
}
{
  "attestation": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  },
  "discussion": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  },
  "review": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  },
  "slash": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  },
  "vouch": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  },
  "project": {
    "ANY_ADDITIONAL_PROPERTY": {
      "userVote": {
        "isUpvote": true,
        "isArchived": true,
        "voter": 1,
        "targetContract": "text",
        "targetId": 1,
        "createdAt": 1,
        "weight": 1,
        "user": {
          "id": 1,
          "profileId": 1,
          "displayName": "text",
          "username": "text",
          "avatarUrl": "https://example.com",
          "description": "text",
          "score": 1,
          "status": "ACTIVE",
          "userkeys": [
            "text"
          ],
          "xpTotal": 1,
          "xpStreakDays": 1,
          "stats": {
            "review": {
              "received": {
                "negative": 1,
                "neutral": 1,
                "positive": 1
              }
            },
            "vouch": {
              "given": {
                "amountWeiTotal": 1,
                "count": 1
              },
              "received": {
                "amountWeiTotal": 1,
                "count": 1
              }
            }
          }
        }
      },
      "counts": {
        "upvotes": 1,
        "downvotes": 1
      }
    }
  }
}