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

III.3.b. Threads

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

Contents

Requests

Create a thread
/action/createThread

Creates a new thread on the specified board. Returns an object containing the created thread number and board name.

The required fields are:

  • boardName The board to create the post on.
  • 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:

  • text The message. Must not be empty if no files are attached.
  • password The password that may be used to edit or delete the thread later. Stored as a SHA-1 hash in the database.
  • markupMode List of markup rule groups used to render the text. Defaults to "EXTENDED_WAKABA_MARK,BB_CODE". May contain the following strings (typically separated by a comma ","):
  • "EXTENDED_WAKABA_MARK"
  • "BB_CODE"
  • email an e-mail.
  • name User's name (nothing to do with the login, just any string).
  • tripcode If the value of this field is "true" and the user is logged in, a tripcode is attached to the post.
  • signAsOp The special [OP] sign is attached to the post if the value is "true".
  • subject The 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:

  • 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.).

Note: On most boards, you have to attach at least one file to create a new thread.

Example:

/action/createThread { boardName=b&file_url_1=http://site.com/files/image.png }

{
    "boardName": "b",
    "threadNumber": 12345
}

On any error, an error object is returned.

Example:

/action/createThread { boardName=b&text=some_text }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Attempt to create a thread without attaching a file"
}
Mark a thread as fixed
/action/setThreadFixed

Marks the target thread as fixed or not fixed. A fixed thread is displayed above regular non-fixed threads. Returns an object containing the thread number and board name of the target thread.

Note: Your access level must be MODER or higher, and higher than the level of a user who created the thread.

The required fields are:

  • boardName Name of the board of the target thread.
  • threadNumber Number of the target thread.

The required fields are:

  • fixed Determines if a thread should be marked as fixed or not. If the value is "true", the thread is marked as fixed, otherwise it is marked as not fixed.

Example:

/action/setThreadFixed { boardName=b&threadNumber=9000&fixed=true }

{
    "boardName": "b",
    "threadNumber": 9000
}

On any error, an error object is returned.

Example:

/action/setThreadFixed { boardName=b&threadNumber=100500 }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No such thread"
}
Mark a thread as closed
/action/setThreadClosed

Marks the target thread as closed or not closed. One can not create posts in a closed thread. Returns an object containing the thread number and board name of the target thread.

Note: Your access level must be MODER or higher, and higher than the level of a user who created the thread.

The required fields are:

  • boardName Name of the board of the target thread.
  • threadNumber Number of the target thread.

The optional fields are:

  • closed Determines if a thread should be marked as closed or not. If the value is "true", the thread is marked as closed, otherwise it is marked as not closed.

Example:

/action/setThreadClosed { boardName=b&threadNumber=9000&closed=true }

{
    "boardName": "b",
    "threadNumber": 9000
}

On any error, an error object is returned.

Example:

/action/setThreadClosed { boardName=b&threadNumber=100500 }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No such thread"
}
Mark a thread as unbumpable
/action/setThreadUnbumpable

Marks the target thread as unbumpable or bumpable. One's posts does not bump an (lift up) an unbumpable thread. Returns an object containing the thread number and board name of the target thread.

Note: Your access level must be MODER or higher, and higher than the level of a user who created the thread.

The required fields are:

  • boardName Name of the board of the target thread.
  • threadNumber Numbr of the target thread.

The optional fields are:

  • unbumpable Determines if a thread should be marked as unbumpable or not. If the value is "true", the thread is marked as unbumpable, otherwise it is marked as bumpable.

Example:

/action/setThreadUnbumpable { boardName=b&threadNumber=9000&unbumpable=true }

{
    "boardName": "b",
    "threadNumber": 9000
}

On any error, an error object is returned.

Example:

/action/setThreadUnbumpable { boardName=b&threadNumber=100500 }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No such thread"
}
Move a thread to another board
/action/moveThread

Moves the specified thread to another board. Post numbers are changed, post links are changed, and attached files are moved. Post search index and other stuff are changed accordingly. Returns an object containing the target board name and the new thread number on the target board.

Note: Your access level must be MODER or higher, and higher than the level of a user who created the thread.

The required fields are:

  • boardName Name of the board of the target thread.
  • threadNumber Number of the target thread.
  • targetBoardName Name of the board to move the target thread to. Must not be equal to boardName.

The optional fields are:

  • password The password that was specified when the thread was created. Not required if the hashpass cookie is set.

Example:

/action/moveThread { boardName=b&threadNumber=9000&targetBoardName=a }

{
    "boardName": "a",
    "threadNumber": 1337
}

On any error, an error object is returned.

Example:

/action/moveThread { boardName=b&threadNumber=9000&targetBoardName=c }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}

Clone this wiki locally