Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Latest commit

 

History

History
115 lines (91 loc) · 1.95 KB

File metadata and controls

115 lines (91 loc) · 1.95 KB

playlists Endpoint

The playlists endpoint retrieves or modifies your playlists.

Endpoint

playlists

playlists/:id

Methods

GET, POST, DELETE

Possible error messages

Insufficient permissions

{
    "data": [],
    "status": "notAuthorized",
}

Data returned for GET

{
    'data': [{              // Contains the requested data
        'active': false,    // Is the playlist currently selected for playback?
        'count': 0,         // Amount of songs in this playlist
        'id': -1,           // ID of the playlist
        'name': 'xxx'       // Name of the playlist
    }],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}

Parameters for POST

name: Name of the new playlist

media: Array of media objects used to fill the playlist

{
    "name": "xxx",
    "media": [{
        "cid": "",
        "title": "xxx",
        "author": "xxx",
        "image": "xxx",
        "duration": 0,
        "format": 1,
        "id": -1
    }]
}

Possible error messages

Insufficient permissions

{
    "data": [
        "You are not authorized to access this resource."
    ],
    "status": "notAuthorized",
}

name or media is missing

{
    "data": [
        "xxxxxxxx is required"
    ],
    "status": "requestError",
}

Data returned for POST

{
    'data': [{              // Contains the requested data
        'active': false,    // Is the playlist currently selected for playback?
        'count': 0,         // Amount of songs in this playlist
        'id': -1,           // ID of the playlist
        'name': 'xxx'       // Name of the playlist
    }],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}

URL Parameters

id: ID of the playlist you want to delete

https://plug.dj/_/playlists/-1

Data returned for DELETE

{
    'data': [],
    'meta': {},
    'status': 'ok',
    'time': 'xx.xxxxxxxxxxx'
}