-
Notifications
You must be signed in to change notification settings - Fork 4
III.3.c. Files
/action/addFiles
Adds specified files to the target post if total post count does not exceed the maximum file count for the board. Returns an object containing the post number, board name and thread number.
The required fields are:
-
boardName
The board of the target post. -
postNumber
The number of the post to add files to.
The optional fields are:
-
password
The password that was specified when the post was created. Not required if thehashpass
cookie is set.
File field names should follow the template: file_ID
, where ID
is an identifier unique for each file.
Files may also be specified as URLs, in which case the field name must follow the template: file_url_ID
, where ID
is an identifier unique for each file URL, and the value of the field should be either a URL (for example, http://site.com/files/image.jpg
), or a special URL-like string, like: vk://UID_TID/TITLE
, where UID
is a Vkontakte user ID, TID
is a Vkontakte audio track ID, and TITLE
is a track title. In that case, the file or a Vkontakte audio-track will be downloaded by the server.
One more option to attach file(s) is to pass a list of file hashes, separated by commas as a value of the fileHashes
field. In that case, the files will be copied if they exist in the database.
To set file rating, the file_ID_rating
field may be used, where ID
matches the ideintifier of file_ID
or file_url_ID
fields, or the hash of the corresponding file passed in the fileHashes
field. The following file ratings are supported:
-
SFW
Safe for work (no socially condemned content). The default. -
R-15
Restricted for 15 years (contains ecchi, idols, violence). -
R-18
Restricted for 18 years (genitalis, coitus, offensive religious/racist/nationalist content). -
R-18G
Restricted for 18 years, guidance advised (shemale, death, guro, scat, defecation, urination, etc.).
Example:
/action/addFiles { boardName=b&postNumber=12345&file_url_1=http://site.com/files/image.png }
{
"boardName": "b",
"postNumber": 12345,
"threadNumber": 9000
}
On any error, an error object is returned.
Example:
/action/addFiles { boardName=b&postNumber=12345&file_url_1=http://site.com/files/image.png }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "Too many files"
}
Note: This request will only succeed if the target file is an audio file (mime type is audio/*
).
/action/editAudioTags
Name of the file.
Track album.
Track artist.
Track title.
Track release year.
This field is used to edit audio tags of a post if hashpass
is not specified (either for the request or for the post).
Changes the specified audio file's tags.
Returns an object with short post description (boardName
, threadNumber
and postNumber
fields).
On any error returns an error object. See Error object for details.
/action/deleteFile
Name of the file to delete.
This field is used to delete a file if hashpass
is not specified (either for the request or for the corresponding post).
Deletes the specified file. If the corresponding post text is null and there are no other files attached to the post, the operation will fail.
Returns an object with short post description (boardName
, threadNumber
and postNumber
fields).
On any error returns an error object. See Error object for details.