forked from klnusbaum/UDJ-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
0.7 Player Creation
klnusbaum edited this page Mar 11, 2013
·
4 revisions
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)
}
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.
- 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
.