Omniplex Docs
PopplioStaging

Votes

These API endpoints are related to votes and voting on IBL

GET
/votes/credit-tiers

Get General Vote Credit Tiers

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

/votes/credit-tiers

Query Parameters

target_typestring

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

curl -X GET "https://spider-staging.omniplex.gg/votes/credit-tiers?target_type=string"

Success

[
  {
    "cents": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "id": "string",
    "position": 0,
    "target_type": "string",
    "votes": 0
  }
]

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

Get Vote Credit Tiers

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

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

Path Parameters

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID of the entity

curl -X GET "https://spider-staging.omniplex.gg/string/string/votes/credit-tiers"

Success

{
  "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": 65535
  },
  "votes": 0
}

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

Get Vote Redeem Logs

Returns a summary of the vote credit redeem logs

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

Path Parameters

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID of the entity

curl -X GET "https://spider-staging.omniplex.gg/string/string/votes/credits"

Success

{
  "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
}

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

Redeem Vote Credits

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

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

The Authorization access token

Authorization

User-Auth<token>

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

In: header

Bot-Auth<token>

Requires a bot token. Should be prefixed with Bot in Authorization header.

In: header

Server-Auth<token>

Requires a server API session token. Should be prefixed with Server in Authorization header.

In: header

Team-Auth<token>

Requires a team API session token. Should be prefixed with Team in Authorization header.

In: header

Path Parameters

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID of the entity

Query Parameters

votes
Required
string

The number of votes to redeem

curl -X POST "https://spider-staging.omniplex.gg/string/string/votes/credits?votes=string" \
  -H "User-Auth: <token>"

Success

{
  "context": {
    "property1": "string",
    "property2": "string"
  },
  "message": "string"
}

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

Get All User Votes

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

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

Path Parameters

uid
Required
string

The users ID

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID of the entity

Query Parameters

pagestring

The page number

curl -X GET "https://spider-staging.omniplex.gg/users/string/string/string/votes/@all?page=string"

Success

{
  "count": 18446744073709552000,
  "per_page": 18446744073709552000,
  "results": [
    {
      "author": "string",
      "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
/{target_type}/{target_id}/votes/user-list

Get 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

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

Path Parameters

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID of the entity

Query Parameters

pagestring

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

curl -X GET "https://spider-staging.omniplex.gg/string/string/votes/user-list?page=string"

Success

[
  "string"
]

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

Get User Entity Votes

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

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

Path Parameters

uid
Required
string

The users ID

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID

curl -X GET "https://spider-staging.omniplex.gg/users/string/string/string/votes"

Success

{
  "has_voted": true,
  "valid_votes": [
    {
      "author": "string",
      "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": 65535
  },
  "wait": {
    "hours": 0,
    "minutes": 0,
    "seconds": 0
  }
}

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

Create Entity Vote

Creates a vote for an entity. Returns 204 on success. Note that for compatibility, a trailing 's' is removed

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

The Authorization access token

Authorization

User-Auth<token>

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

In: header

Path Parameters

uid
Required
string

The users ID

target_type
Required
string

The target type of the entity

target_id
Required
string

The target ID

Query Parameters

upvote
Required
string

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

curl -X PUT "https://spider-staging.omniplex.gg/users/string/string/string/votes?upvote=string" \
  -H "User-Auth: <token>"

Success

{
  "context": {
    "property1": "string",
    "property2": "string"
  },
  "message": "string"
}