Skip to content

Playlists

Matthew Martin edited this page Jun 9, 2020 · 2 revisions

/x-epi/playlists

GET

Returns a list of the playlists currently on the machine

HTTP Status Code: 200

Body: application/json

[
    {
        "label": string - a human readable title of the playlist
        "uid": string - the unique identifier for the playlist
    },
]

POST

Uploads a new playlist to the machine

Body: application/json

{
    "label": string - a human readable title of the playlist
    "description": string - a description of the playlist
    "files":    
    [
        { 
            "uid": string - the unique identifier for the audio resource to play,
            "times_to_play": integer - the number of times to play the audio resource. -1 = keep playing,
        },...
     ]
}

HTTP Status Code: 201

The playlist has been uploaded successfully

Body: application/json

{
    "result": boolean - true if this particular playlist was uploaded,
    "uid": string - the unique id of the resource that has been uploaded
}

HTTP Status Code: 400

The data sent to the endpoint was incorrect in some way

Body: application/json

{
    "result": boolean - false, 
    "reason": 
    [ 
        an array of strings giving the reasons for the failure 
    ],
    "data": 
    { 
        the json that was sent to the server 
    }
}

HTTP Status Code: 409

A playlist already exists on the server with the given label or the server could not create a unique id

Body: application/json

{
    "result": boolean - false, 
    "reason": 
    [ 
        an array of strings giving the reasons for the failure 
    ],
    "data": 
    { 
        the json that was sent to the server 
    }
}

HTTP Status Code: 423

Returned when the system has been locked using the Status API endpoint

Body: application/json

{
    "result": false,
    "reason": 
    [
        "the system is locked"
    ]
}
Clone this wiki locally