POST ​/api​/v3​/vote

Cast an up or down vote for a track.

Request

Example Request

{
  "auth_token": "ef43987dc3dfca56255915d3b109714ecd4516ac54f527",
  "station_id": {
  },
  "vote": {
    "owner_id": {
    },
    "owner_type": {
    },
    "track_id": {
    },
    "up": true
  }
}

Example Parameters

  • auth_token: The auth_token of the currently authenticated user.

    • Required: no
    • Type: string
    • Example: ef43987dc3dfca56255915d3b109714ecd4516ac54f527
  • station_id: Station from which the vote was cast

    • Required: no
    • Type: Integer
    • Example: 10
    • %{key} %{@schema[key]}
  • vote: The vote object to create.

    • Required: yes
    • owner_id: The owner ID for the user casting the vote.
      • Required: yes
      • Type: Integer
      • Example: 1
    • owner_type: The polymorphic owner type. Can be Account or GuestAccount.
      • Required: yes
      • Type: String
      • Example: Account
    • track_id: The track ID to vote for.
      • Required: yes
      • Type: Integer
      • Example: 1
    • up: If this is an up vote. Default is true. False indicates a down vote.
      • Required: no
      • Type: boolean
      • Example: true

Response

Example Response

{
  "vote": {
    "id": {
    },
    "owner_id": {
    },
    "owner_type": {
    },
    "track_id": {
    },
    "up": true
  }
}

Response Parameters

  • vote: The vote object to create.

    • Required: yes
    • id: The unique identifier for the vote.
      • Required: yes
      • Type: Integer
      • Example: 1
    • owner_id: The owner ID for the user casting the vote.
      • Required: yes
      • Type: Integer
      • Example: 1
    • owner_type: The polymorphic owner type. Can be Account or GuestAccount.
      • Required: yes
      • Type: String
      • Example: Account
    • track_id: The track ID to vote for.
      • Required: yes
      • Type: Integer
      • Example: 1
    • up: If this is an up vote. Default is true. False indicates a down vote.
      • Required: yes
      • Type: boolean
      • Example: true

Response Codes

Successful Response Codes

  • 201: A valid response

Failure Response Codes

  • 422: Indicates a bad request including validation errors.

  • 400: Indicates a bad request with incorrect parameters.

  • 401: This request failed authentication.