Skip to content

0.7 Player Creation

klnusbaum edited this page Mar 11, 2013 · 4 revisions

Back to 0.7 API

Endpoints:

/players

PUT

Creates a new player. The owner is set to the user calling this method. This method should be given the following JSON:

{
  "name" : name of player,
  "location": (optional) {
    "address": Address where player is located (optional),
    "locality": Locality/City where player is located (optional),
    "region": Regions, State, or Providence where player is located (optional),
    "postal_code": Postal code of where player is located,
    "country": Country in which the player is located,
  },
  "password" : password (optional),
  "sorting_algorithm_id" : id of the sorting algorithm to be used for the playlist (optional)
}

Success - HTTP 201: Created

A single permission group for the player will also be automatically created called owner. The owner group will consist of just the player creater (the user calling this method).

Permissions for the player will be set to defaults deemed reasonable by the server implementation.

Errors

  • HTTP 400 - Bad Request - Response "Bad JSON" - Your JSON was malformed
  • HTTP 400 - Bad Request - Response "Must include non-blank name parameter" - No name supplied
  • HTTP 400 - Bad Request - Response "Location not found".
  • HTTP 400 - Bad Request - Response "Bad password" - the password does not conform to whatever standards the server has set for passwords.
  • HTTP 404 - Not Found - Header "X-Udj-Missing-Resource" set to sorting-algorithm. An unknown sorting algorithm was specified.
  • HTTP 409 - Conflict - The user already has a player with that name.
  • HTTP 415 - Unsupported Media Type - The request must have content-type text-/json.
Clone this wiki locally