-
Notifications
You must be signed in to change notification settings - Fork 4
III.3.f. Other
- Search for posts
- Markup text
- Send private chat message
- Delete private chat messages
- Set synchronization data
/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:
-
querySearch query containing space-separated entries in the following format:
-
+wordPost must contain the word. -
-wordPost must NOT contain the word. -
wordPost 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:
-
boardNameName 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"
}
/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:
-
boardNameThe board context to mark the post up within. -
textThe message. -
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"
-
tripcodeIf the value of this field is"true"and the user is logged in, a tripcode is generated and included in the resulting object. -
signAsOpHas 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"
}
/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:
-
boardNameName of the board of the target user's post. -
postNumberNumber of the target user's post. -
textThe 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"
}
/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:
-
boardNameName of the board of the target user's post. -
postNumberNumber 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"
}
/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:
-
keyA key used to retrieve the data. -
dataThe 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"
}