Skip to content
This repository has been archived by the owner on Aug 6, 2022. It is now read-only.

III.3.c. Files

Andrey Bogdanov edited this page Feb 27, 2016 · 8 revisions

Contents

Requests

Add files to a post
/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 the hashpass 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"
}

Edit audio tags

Note: This request will only succeed if the target file is an audio file (mime type is audio/*).

Request

/action/editAudioTags

Fields

fileName

Name of the file.

album

Track album.

artist

Track artist.

title

Track title.

year

Track release year.

password

This field is used to edit audio tags of a post if hashpass is not specified (either for the request or for the post).

Effect

Changes the specified audio file's tags.

Result

Returns an object with short post description (boardName, threadNumber and postNumber fields).

Error

On any error returns an error object. See Error object for details.

Delete file

Request

/action/deleteFile

Fields

fileName

Name of the file to delete.

password

This field is used to delete a file if hashpass is not specified (either for the request or for the corresponding post).

Effect

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.

Result

Returns an object with short post description (boardName, threadNumber and postNumber fields).

Error

On any error returns an error object. See Error object for details.

Clone this wiki locally