VK Audio API reference for VK Audio Token
Index
API Methods
General info
New API Methods

execute.getPlaylist

Get playlist audios

Parameters:

NameValue
idId of the playlist
owner_idId of the owner of the playlist
access_keyMay be needed when owner id starts with "-"
audio_offset (optional)Offset to skip that number of audios
audio_count (optional)Maximum number of audios to return
need_playlist (optional)1 - return information about the playlist: title, followers, plays..., 0 - don't return it (default)
need_owner (optional)1 - return information about the owner: photo, type, name..., 0 - don't return it (default)

Access key must match access key of the playlist, for example, returned by catalog.getAudioArtist method

Example (VK Official):

$id = 12345;
$owner_id = -67890;
$access_key = '1234abc567';
curl_setopt(
$ch, CURLOPT_URL, "https://api.vk.com/method/execute.getPlaylist"
);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"v=5.116&https=1&id=$id&owner_id=${owner_id}&access_key=${access_key}".
"&need_playlist=1&need_owner=0&lang=en&access_token=".TOKEN
);
<?php
include __DIR__.'/../../autoloader.php';
use Vodka2\VKAudioToken\SupportedClients;
//Credentials obtained by example_vkofficial.php script
define('TOKEN', $argv[1]);
define('USER_AGENT', SupportedClients::VkOfficial()->getUserAgent());
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER, array('User-Agent: '.USER_AGENT));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$id = 12345;
$owner_id = -67890;
$access_key = '1234abc567';
curl_setopt(
$ch, CURLOPT_URL, "https://api.vk.com/method/execute.getPlaylist"
);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"v=5.116&https=1&id=$id&owner_id=${owner_id}&access_key=${access_key}".
"&need_playlist=1&need_owner=0&lang=en&access_token=".TOKEN
);
echo json_encode(json_decode(curl_exec($ch)), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n\n";