Skip to main content

Web Socket

Web Socket server URL

Production URL :

wss://api.lnchbx.com/

Develop URL :

wss://dev-api.lnchbx.com/

Connect Noteboard websocket

tId=Tab Id&wsId=Board Id&userId=User ID&token=User token&name=Name
Query
nametypedata typedescription
tIdrequiredstringBrowser Tab ID (random)
userIdrequiredstringUser ID
wsIdrequiredstringBoard ID
tokenrequiredstringUser Token
namerequiredstringUser name

Ready

The following command is sent when user is connected

cmd: READY


Get Notes

cmd: GET_MULTI_NOTES

Responses

cmd: COMBINE_NOTES, notes: [Note], count: Notes count, total_count: Total notes count


Add new note

cmd: ADD_NOTE, note: Note object, tags: [Tag name], label: Color label,

Body
nametypedata typedescription
noterequiredstringNote Object
tagsoptionalstringArray of Tags
labeloptionalstringColor label
Example
  {
cmd: 'ADD_NOTE',
note: {
title: 'AI Feature',
content: '<h1>About AI</h1>',
contentRaw: 'block: {....}',
drawing: '{url: "https://image1.jpg"}',
}
label: 'color6',
tags: ['lunchbox', 'aws'],
}

Update note

cmd: UPDATE_NOTE, id: Note Id, title: Note Title, content: Html data, contentRaw: Raw data, drawing: Image object, label: color label, tags: [Tags],

Body
nametypedata typedescription
idrequiredstringNote ID
contentoptionalstringHtml content string
contentRawoptionalstringProsemirror JSON string
drawingoptionalstringImage object
labeloptionalstringColor label
tagsoptionalstringArray of tags
Example
  {
cmd: 'UPDATE_NOTE',
id: 'Note Id-1',
content: '<h1>About AI</h1>',
contentRaw: 'block: {....}',
drawing: '{url: "https://image1.jpg"}',
label: 'color6',
tags: ['lunchbox', 'aws'],
}

Move Note

cmd: RESIZE_NOTE, id: Note Id, x: Target coordinate x, y: Target coordinate y

Body
nametypedata typedescription
idrequiredstringNote ID
xrequiredstringTarget Coordinate X
yrequiredstringTarget Coordinate Y
Example
  {
cmd: 'RESIZE_NOTE',
id: 'Note Id-1'
x: 1,
y: 1
}

Forward note

cmd: FORWARD_NOTE, notes: [Note object], target: Board ID

Body
nametypedata typedescription
notesrequiredstringArray of Note object
targetrequiredstringBoard ID
Example
  {
cmd: 'FORWARD_NOTE',
notes: [
{
id: 'Note Id-1',
content: '<span>test</span>',
contentRaw: '{block ...}'
}
],
target: 'Board Id-2'
}

Delete note

cmd: REMOVE_NOTE, ids: [Note Id]

Body
nametypedata typedescription
idsrequiredstringArray of Note ID
Example
 {
cmd: 'REMOVE_NOTE',
ids: ['Note Id-1', 'Note Id-2']
}

Add Comment

cmd: ADD_COMMENT, id: Note Id, text: comment

Body
nametypedata typedescription
idrequiredstringNote ID
textrequiredstringComment text
Example
  {
cmd: 'ADD_COMMENT',
id: 'Note Id-1',
text: 'My first comment'
}

Update note color

cmd: REMOVE_NOTE, ids: [Note Id], label: Color label

Body
nametypedata typedescription
idsrequiredstringArray of Note ID
labelrequiredstringColor label in format color1, etc ...
Example
  {
cmd: 'UPDATE_COLOR',
ids: ['Note Id-1', 'Note Id-2'],
label: 'color2'
}

Update note tag

cmd: UPDATE_TAG, ids: [Note Id], tags: [Tags]

Body
nametypedata typedescription
idsrequiredstringArray of Note ID
tagsrequiredstringArray of tag name
Example
  {
cmd: 'UPDATE_TAG',
ids: ['Note Id-1', 'Note Id-2'],
tags: ['pain', 'todo']
}

Add new tag

cmd: ADD_TAG, tag: Tag

Body
nametypedata typedescription
idsrequiredstringArray of Note ID
tagrequiredstringNew tag name
Example
  {
cmd: 'ADD_TAG',
tag: 'summary'
}

Add new reaction

cmd: ADD_REACTION, id: Note ID index: Reaction Index

Body
nametypedata typedescription
idrequiredstringNote ID
indexrequiredintegerReaction index (0-4)
Example
  {
cmd: 'ADD_REACTION',
id: 'note-id',
index: 2
}

Remove reaction

cmd: REMOVE_REACTION, id: Note ID

Body
nametypedata typedescription
idrequiredstringNote ID
Example
  {
cmd: 'REMOVE_REACTION',
id: 'note-id'
}

Add comment

cmd: ADD_COMMENT, id: Note ID text: Comment text

Body
nametypedata typedescription
idrequiredstringNote ID
textrequiredstringText content
Example
  {
cmd: 'ADD_COMMENT',
id: 'note-id',
text: 'This idea is brilliant'
}

Add reply comment

cmd: ADD_COMMENT, id: Note ID text: Comment text parent: Reply Note ID

Body
nametypedata typedescription
idrequiredstringNote ID
textrequiredstringText content
parentrequiredstringReply Parent Note ID
Example
  {
cmd: 'ADD_COMMENT',
id: 'note-id',
text: 'I like your feedback',
parent: 'reply to note id'
}

Remove comment

cmd: REMOVE_COMMENT, id: Note ID commentId: Comment ID

Body
nametypedata typedescription
idrequiredstringNote ID
commentIdrequiredstringComment ID
Example
  {
cmd: 'REMOVE_COMMENT',
id: 'note-id',
commentId: 'Removed comment ID'
}

Add comment reaction

cmd: ADD_REACTION, id: Note ID commentId: Comment ID index: Reaction Index

Body
nametypedata typedescription
idrequiredstringNote ID
commentIdrequiredstringComment ID
indexrequiredintegerReaction index (0-4)
Example
  {
cmd: 'ADD_REACTION',
id: 'note-id',
commentId: 'comment-id',
index: 2
}

Remove comment reaction

cmd: REMOVE_REACTION, id: Note ID commentId: Comment ID

Body
nametypedata typedescription
idrequiredstringNote ID
commentIdrequiredstringComment ID
Example
  {
cmd: 'REMOVE_REACTION',
id: 'note-id'
commentId: 'comment-id'
}