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

III.3.f. Other

Andrey Bogdanov edited this page Mar 19, 2016 · 1 revision

Contents

Requests

Search for posts
/action/search

Searches for posts with the text/subject satisfying the search query. Returns an object containing the found posts. Queried words are highlighted.

Note: Unlike other POST requests, this one does not change anything on the server.

The required fields are:

  • query Search query containing space-separated entries in the following format:
  • +word Post must contain the word.
  • -word Post must NOT contain the word.
  • word Post may contain the word.
  • "two words" Phrase treated as an integral word. The above prefixes may be applied to the phrase.

The optional fields are:

  • boardName Name of the board where to search for posts. * may be used to search on all boards (the default).

Example:

/action/search { query=+test&boardName=d }

{
    "searchQuery": "+test",
    "searchBoard": "d",
    "phrases": [
        "test"
    ],
    "searchResults": [
        {
            "boardName": "b",
            "postNumber": 31194,
            "threadNumber": 7770,
            "subject": "",
            "text": "A test post."
        }
    ]
}

On any error, an error object is returned:

/action/search { query=+test&boardName=c }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Markup text
/action/markupText

Applies markup to the text. Returns an object representing the parsed post draft.

Note: Unlike other POST requests, this one does not change anything on the server.

The required fields are:

  • boardName The board context to mark the post up within.
  • text The message.
  • 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"
  • tripcode If the value of this field is "true" and the user is logged in, a tripcode is generated and included in the resulting object.
  • signAsOp Has no effect, the value is just added to the resulting object if the value if "true".

Example:

/action/markupText { boardName=b&text=[b]bold[/b] }

{
    "boardName": "b",
    "text": "<b>bold</b>",
    "rawText": "[b]bold[/b]",
    "options": {
        "signAsOp": false,
        "showTripcode": false
    },
    "createdAt": "2016-02-27T13:17:08.541Z"
}

On any error, an error object is returned.

Example:

/action/markupText { boardName=c&text=[b]bold[/b] }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Send private chat message
/action/sendChatMessage

Adds the message to the chat identified by the board name and the post number. The operation fails if another two users are already using the chat identified by the board name and the post number. Returns an empty object.

Note: If no new messages are appended to the chat within 7 days (the default, may be changed using the configuration file), the chat is deleted from the database.

The required fields are:

  • boardName Name of the board of the target user's post.
  • postNumber Number of the target user's post.
  • text The message.

Example:

/action/sendChatMessage { boardName=b&postNumber=9000&text=hello }

{}

On any error, an error object is returned.

Example:

/action/sendChatMessage { boardName=b&postNumber=9000&text=hi }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Somebody is chatting here already"
}
Delete private chat messages
/action/deleteChatMessages

Detaches the the chat identified by the board name and the post number from the user. Messages are NOT deleted and will be accessible by the interlocutor. This action does NOT prevent the user from receiving messages with the specified chat identifier if the interlocutor sends one again. Returns an empty object.

The required fields are:

  • boardName Name of the board of the target user's post.
  • postNumber Number of the target user's post.

Example:

/action/deleteChatMessages { boardName=b&postNumber=9000 }

{}

On any error, an error object is returned.

Example:

/action/deleteChatMessages { boardName=c&postNumber=9000 }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Set synchronization data
/action/synchronize

Stores user synchronization data (browser localStorage and cookies content) on the server to synchronize with other devices. Returns an empty object.

Note: By default, the data is deleted within 5 minutes after being stored.

The required fields are:

  • key A key used to retrieve the data.
  • data The data itself. Must be a stringified JSON.
/action/synchronize { key=my_key&data=... }

{}

On any error, an error object is returned.

Example:

/action/synchronize { data=... }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No key specified"
}

Clone this wiki locally