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

audio.edit

Edits an audio file on a user or community page

Parameters:

NameValue
owner_id (integer)ID of the user or community that owns the audio file
audio_id (positive number)Audio file ID
artist (string, optional)Name of the artist
title (string, optional)Title of the audio file
text (string, optional)Text of the lyrics of the audio file
genre_id (positive number, optional)Genre of the audio file. See the list of audio genres
no_search (flag, either 1 or 0)1 — audio file will not be available for search. 0 — audio file will be available for search (default)

This method is only available for audio files uploaded by users

Example (Kate):

$ownerId = 371745461;
$audioId = 456289486;
$artist = "New artist";
$title = "New title";
curl_setopt(
$ch,
CURLOPT_URL,
"https://api.vk.com/method/audio.edit?access_token=".TOKEN.
"&owner_id=$ownerId".
"&audio_id=$audioId".
"&artist=".urlencode($artist).
"&title=".urlencode($title).
"&v=5.95"
);
<?php
include __DIR__.'/../../autoloader.php';
use Vodka2\VKAudioToken\SupportedClients;
//Token obtained by example_microg.php script
define('TOKEN', $argv[1]);
define('USER_AGENT', SupportedClients::Kate()->getUserAgent());
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER, array('User-Agent: '.USER_AGENT));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ownerId = 371745461;
$audioId = 456289486;
$artist = "New artist";
$title = "New title";
curl_setopt(
$ch,
CURLOPT_URL,
"https://api.vk.com/method/audio.edit?access_token=".TOKEN.
"&owner_id=$ownerId".
"&audio_id=$audioId".
"&artist=".urlencode($artist).
"&title=".urlencode($title).
"&v=5.95"
);
echo json_encode(json_decode(curl_exec($ch)), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n\n";