-
Notifications
You must be signed in to change notification settings - Fork 4
III.3.a. Posts
/action/createPost
Creates a new post in the specified thread on the specified board. Returns an object containing the created post number and board name.
The required fields are:
-
boardNameThe board to create the post on. -
threadNumberThe thread to create the post in. - Captcha challenge and response fields. Depends on the captcha engine used. Not required if the captcha uota for the user is greater than 0.
The optional fields are:
-
textThe message. Must not be empty if no files are attached. -
passwordThe password that may be used to edit or delete the post later. Stored as a SHA-1 hash in the database. -
markupModeList of markup rule groups used to render thetext. Defaults to"EXTENDED_WAKABA_MARK,BB_CODE". May contain the following strings (typically separated by a comma ","):
"EXTENDED_WAKABA_MARK""BB_CODE"
-
emailEither an e-mail or the special value"sage"(case-insensitive) to indicate that a post must not bump (lift up) the thread. -
nameUser's name (nothing to do with the login, just anystring). -
tripcodeIf the value of this field is"true"and the user is logged in, a tripcode is attached to the post. -
signAsOpIf the user who made this post and the user who made the first post of the thread (the OP) are the same user, the special[OP]sign is attached to the post if the value if"true". -
subjectThe subject of the post.
You may also attach files to the post (at least one file is required if the text field is empty). 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:
-
SFWSafe for work (no socially condemned content). The default. -
R-15Restricted for 15 years (contains ecchi, idols, violence). -
R-18Restricted for 18 years (genitalis, coitus, offensive religious/racist/nationalist content). -
R-18GRestricted for 18 years, guidance advised (shemale, death, guro, scat, defecation, urination, etc.).
Example:
/action/createPost { boardName=b&threadNumber=9000&file_url_1=http://site.com/files/image.png }
{
"boardName": "b",
"postNumber": 12345
}
On any error, an error object is returned.
Example:
/action/createPost { boardName=b&threadNumber=9000 }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "Both file and comment are missing"
}
/action/editPost
Modifies an existing post. Returns an object containing the edited post number and board name.
Note: Your access level must be MODER or higher (unless OP moderation is enabled), and higher than the level of a user who created the post.
The required fields are:
-
boardNameThe board of a post to edit. -
postNumberThe number of a post to edit.
The optional fields are:
-
textThe message. Must not be empty if no files are attached to the post. -
passwordThe password that was specified when the post was created. Not required if thehashpasscookie is set. -
markupModeList of markup rule groups used to render thetext. Defaults to"EXTENDED_WAKABA_MARK,BB_CODE". May contain the following strings (typically separated by a comma ","):
"EXTENDED_WAKABA_MARK""BB_CODE"
-
emailEither an e-mail or the special value"sage"(case-insensitive) to indicate that a post must not bump (lift up) the thread. -
nameUser's name (nothing to do with the login, just anystring). -
subjectThe subject of the post.
Example:
/action/editPost { boardName=b&postNumber=12345&text=new_text }
{
"boardName": "b",
"postNumber": 12345
}
On any error, an error object is returned:
Example:
/action/editPost { boardName=b&postNumber=100500 }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "No such post"
}
/action/deletePost
Deletes the specified post. If a post is the first post in a thread, deletes the entire thread. Returns an object containing the deleted post number and board name.
The required fields are:
-
boardNameThe board of a post to delete. -
postNumberThe number of a post to delete.
The optional fields are:
-
passwordThe password that was specified when the post was created. Not required if thehashpasscookie is set. -
archivedIf the value of this field is"true", and the post is the first post in the corresponding thread, the thread is deleted from the archive. Otherwise, the thread or the post is deleted as a normal post/thread. Note: deleting posts from an archived threads is not allowed.
Example:
/action/deletePost { boardName=b&postNumber=12345 }
{
"boardName": "b",
"postNumber": 12345
}
On any error, an error object is returned:
Example:
/action/deletePost { boardName=b&postNumber=100500 }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "No such post"
}