Omniplex Docs

Votes

These API endpoints are related to votes and voting on Omniplex

GET
/votes/credit-tiers

Returns a list of all currently available vote credit tiers sorted in ascending order

Query Parameters

target_type?string

The target type to filter by. If unset, will not filter by target type.

Response Body

Success

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://spider.omniplex.gg/votes/credit-tiers'
Example Response
[  {    "cents": 0,    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "position": 0,    "target_type": "string",    "votes": 0  }]

Get Voter Leaderboard

GET
/votes/leaderboard

Returns the most active voters by upvotes cast, all-time or since the last monthly vote reset. Votes staff voided with a per-entity reset and votes from vote-banned or banned users are not counted. Cached for 5 minutes.

Query Parameters

limit?string

How many voters to return. Defaults to 10, capped at 50.

period?string

all (default) for all-time, or month for votes since the last monthly vote reset.

Response Body

Success

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://spider.omniplex.gg/votes/leaderboard'
Example Response
[  {    "bot_votes": 0,    "favorite": {      "avatar": "string",      "name": "string",      "target_id": "string",      "target_type": "string",      "vanity": "string",      "votes": 0    },    "other_votes": 0,    "rank": 0,    "server_votes": 0,    "user": {      "avatar": "string",      "bot": true,      "display_name": "string",      "extra_data": {        "property1": null,        "property2": null      },      "flags": [        "string"      ],      "id": "string",      "status": "string",      "username": "string"    },    "votes": 0  }]
GET
/votes/leaderboard/users/{user_id}

Returns one user's position on the voter leaderboard, counted the same way as Get Voter Leaderboard. A rank of 0 means the user has no counted upvotes in the period. Cached for 5 minutes.

Path Parameters

user_id*string

The user's ID

Query Parameters

period?string

all (default) for all-time, or month for votes since the last monthly vote reset.

Response Body

Success

application/json
  1. response
next_reset?string

When monthly votes next reset: 00:00 UTC on the 1st, or a month later if staff already reset every listing type at the end of this month

Formatdate-time
period_start?string

When the period started, null for all-time

Formatdate-time
rank?integer

The user's position on the leaderboard, 0 if they have no counted upvotes in the period

total_voters?integer

How many users have counted upvotes in the period

votes?integer

The user's upvote count in the period

Example Request
curl -X GET 'https://spider.omniplex.gg/votes/leaderboard/users/string'
Example Response
{  "next_reset": "2019-08-24T14:15:22Z",  "period_start": "2019-08-24T14:15:22Z",  "rank": 0,  "total_voters": 0,  "votes": 0}

Get Vote Credit Tiers

GET
/{target_type}/{target_id}/votes/credit-tiers

Returns a summary of the tiers and the slab based breakdown of votes for a given entity

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Response Body

Success

application/json
  1. response
slab_overview?array<>

Slab-based overview with each index, i, representing the amount of votes in Tiers[i]

tiers?array<>

The vote credit tiers

total_credits?integer

The total amount of credits the user would get, in cents

vote_info?

Some information about the vote

votes?integer

The amount of not-yet-redeemed votes the entity has available to convert -- excludes votes an earlier redemption already claimed, but not the entity's public vote total

Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/votes/credit-tiers'
Example Response
{  "slab_overview": [    0  ],  "tiers": [    {      "cents": 0,      "created_at": "2019-08-24T14:15:22Z",      "id": "string",      "position": 0,      "target_type": "string",      "votes": 0    }  ],  "total_credits": 0,  "vote_info": {    "multiple_votes": true,    "per_user": 0,    "supports_downvotes": true,    "supports_partial_vote_credits_redeem": true,    "supports_upvotes": true,    "vote_credits": true,    "vote_time": 0,    "weekend_bonus": true  },  "votes": 0}

Get Vote Redeem Logs

GET
/{target_type}/{target_id}/votes/credits

Returns a summary of the vote credit redeem logs

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Response Body

Success

application/json
  1. response
available_credits?integer

The total amount of credits that can be redeemed

redeemed_credits?integer

The total amount of credits that have been redeemed

redeems?array<>

The vote credit redeem logs

total_credits?integer

The total amount of credits available

Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/votes/credits'
Example Response
{  "available_credits": 0,  "redeemed_credits": 0,  "redeems": [    {      "created_at": "2019-08-24T14:15:22Z",      "credits": 0,      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "redeemed_at": "2019-08-24T14:15:22Z",      "redeemed_credits": 0,      "target_id": "string",      "target_type": "string"    }  ],  "total_credits": 0}

Redeem Vote Credits

POST
/{target_type}/{target_id}/votes/credits

Redeems votes into credits towards the shop based on the vote credit tiers

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

votes*string

The number of votes to redeem

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/votes/credits?votes=string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get All User Votes

GET
/users/{uid}/{target_type}/{target_id}/votes/@all

Gets all votes (paginated by 10) of a user on an entity. This endpoint is currently public as the same data can be found through #vote-logs in discord. Note that for compatibility, a trailing 's' is removed

Path Parameters

uid*string

The users ID

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

page?string

The page number

Response Body

Success

application/json
  1. response
count?integer
Range0 <= value <= 18446744073709552000
per_page?integer
Range0 <= value <= 18446744073709552000
results?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/string/string/votes/@all'
Example Response
{  "count": 0,  "per_page": 0,  "results": [    {      "author": "string",      "auto": true,      "created_at": "2019-08-24T14:15:22Z",      "credit_redeem": "d88a5dd2-1993-40f4-8f80-9b33ccb4e8e4",      "immutable": true,      "itag": "6b5f8e7b-1e8c-4611-b693-ee8faa950c62",      "target_id": "string",      "target_type": "string",      "upvote": true,      "void": true,      "void_reason": "string",      "voided_at": "2019-08-24T14:15:22Z",      "vote_num": 0    }  ]}

Get Entity Voters

GET
/{target_type}/{target_id}/votes/voters

Returns the users who have upvoted an entity, with their upvotes since the last vote reset and of all time, ordered by current votes, then all-time votes, then most recent vote. Voters whose profile can't be resolved are left out.

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

limit?string

How many voters to return. Defaults to 24, capped at 100.

Response Body

Success

application/json
  1. response
total?integer

How many users have ever upvoted this entity

voters?array<>

The voters, ordered by current votes, then all-time votes, then most recent vote

Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/votes/voters'
Example Response
{  "total": 0,  "voters": [    {      "last_voted_at": "2019-08-24T14:15:22Z",      "total_votes": 0,      "user": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "votes": 0    }  ]}

Get Votes User List

GET
/{target_type}/{target_id}/votes/user-list

Gets the full list of all users who have voted for the entity on Discord as a list of snowflakes. Note that for compatibility, a trailing 's' is removed. This method does not require authentication as it is easily publicly available through other means

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

page?string

The page number (if pagination is desired, otherwise sends all results)

Response Body

Success

application/json
  1. response
[index: integer]?string
Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/votes/user-list'
Example Response
[  "string"]

Get User Entity Votes

GET
/users/{uid}/{target_type}/{target_id}/votes

Gets all valid (current) votes a user has made for an entity

Path Parameters

uid*string

The users ID

target_type*string

The target type of the entity

target_id*string

The target ID

Response Body

Success

application/json
  1. response
has_voted?boolean

Whether or not the user has voted for the entity. If an entity supports multiple votes, this will be true if the user has voted in the last vote time, otherwise, it will be true if the user has voted at all

valid_votes?array<>

A list of all non-voided votes the user has made on the entity

vote_info?

Some information about the vote

wait?

The time until the user can vote again

Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/string/string/votes'
Example Response
{  "has_voted": true,  "valid_votes": [    {      "author": "string",      "auto": true,      "created_at": "2019-08-24T14:15:22Z",      "credit_redeem": "d88a5dd2-1993-40f4-8f80-9b33ccb4e8e4",      "immutable": true,      "itag": "6b5f8e7b-1e8c-4611-b693-ee8faa950c62",      "target_id": "string",      "target_type": "string",      "upvote": true,      "void": true,      "void_reason": "string",      "voided_at": "2019-08-24T14:15:22Z",      "vote_num": 0    }  ],  "vote_info": {    "multiple_votes": true,    "per_user": 0,    "supports_downvotes": true,    "supports_partial_vote_credits_redeem": true,    "supports_upvotes": true,    "vote_credits": true,    "vote_time": 0,    "weekend_bonus": true  },  "wait": {    "hours": 0,    "minutes": 0,    "seconds": 0  }}

Create Entity Vote

PUT
/users/{uid}/{target_type}/{target_id}/votes

Creates a vote for an entity. Returns 204 on success. Note that for compatibility, a trailing 's' is removed. If the target is a bot or server that has not opted out of captchas, the request body must be {"token": "..."} with a Cloudflare Turnstile token rendered with the action "vote"

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The users ID

target_type*string

The target type of the entity

target_id*string

The target ID

Query Parameters

upvote*string

Whether or not to upvote the entity. Must be either true or false

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X PUT 'https://spider.omniplex.gg/users/string/string/string/votes?upvote=string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}