Tangled Public API
Public API for tangled.com
Authentication
Every endpoint requires an API key passed as the idem_api_token query parameter. Two key types exist and are not interchangeable:
exchange key — used by the /api_public/exchange/exchange_* endpoints (trading).application key — used by all other /api_public/* endpoints (content, comments, payments, notifications).
Requests
All POST endpoints take a JSON request body (Content-Type: application/json). Sending an empty string for an optional field is the same as not sending the field.
Response envelope
Every endpoint always answers with HTTP 200, even on failure — never rely on the HTTP status code. Instead check the status field of the JSON body:
- Error:
status is false (or "fail"). If the error is a handled exception, a code property holds its code (see ErrorCode); an error may also come without code. A result_error array may hold extra details. - Success:
status may be true (or "success"), or the field may be absent entirely and the response body is just the requested data.
File uploads
Files (images, videos, attachments) are not sent through the REST API. Uploading is a two step flow: first Insert idem upload to get an idem_upload_guid, then upload the file with a tus client, sending that guid in a header. See Upload a file with tus in the Uploads section.
Chat socket
Real-time chat is not part of the REST API above. It runs over a WebSocket at wss://chat.tangled.com/chat/socket and does not use the response envelope or the idem_api_token query parameter. See the Chat Socket section.
Base URL:
https://tangled.com
Uploads
POST /api_public/O1JpeADvzQxl9OtJY4zbDjjf
Auth: ApplicationApiKey — idem_api_token (query)
Creates an idem_upload record. Takes no parameters, send an empty request. The response contains data.idem_upload_guid, which must be sent as the x-idem-upload-guid header when uploading the file with tus (see Upload a file with tus). Call it once per file.
Responses
HTTP 200
Always HTTP 200. Check status in the body, see the "Response envelope" note above. On success data contains idem_upload_guid.
application/json
Success
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
data | object | | Field | Type | Description |
|---|
idem_upload_guid | string | Send it as the x-idem-upload-guid header of the tus upload. |
|
result_error | array | array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
TUS https://content-0001-upload.tangled.com/tus/upload
Resumable upload of one file with a tus client (for example tus-js-client).
Flow
- Call Insert idem upload and read
data.idem_upload_guid from the response. - Start a tus upload to the upload endpoint, with the headers and metadata below.
- When the upload finishes, the file is available under that
idem_upload_guid.
Notes
- The upload does not use the
idem_api_token query parameter and the status envelope. It is identified by the headers below. - Use one
idem_upload_guid per file. - Chunks are sent with
PATCH of at most 5 MB each, the client resumes from the last confirmed offset.
Headers
| Name | Type | Description |
|---|
x-idem-guid required | string | idem_guid of the user who uploads the file. |
x-role required | string | What the uploaded file is used for. Sent as the x-role header of the tus upload.
content_attachment — file attached to content (image, file)content_attachment_video — video attached to contentcomment_attachment — file attached to a comment
Allowed values: content_attachment, content_attachment_video, comment_attachment |
x-idem-upload-guid required | string | idem_upload_guid from Insert idem upload.
|
Upload metadata
Sent with the tus Upload-Metadata header, the client encodes it for you.
| Name | Type | Description |
|---|
filename required | string | Original file name. |
filetype required | string | MIME type of the file, e.g. image/png. |
authorIdemGuid required | string | idem_guid of the user who uploads the file. Same value as x-idem-guid. |
Client settings
Chunk size: 5000000 bytes · Retry delays: 0, 3000, 6000, 12000, 24000 ms
Example
new tus.Upload(file, {
endpoint: 'https://content-0001-upload.tangled.com/tus/upload',
retryDelays: [0, 3000, 6000, 12000, 24000],
chunkSize: 5 * 1000 * 1000,
headers: {
'x-idem-guid': idemGuid,
'x-role': 'content_attachment',
'x-idem-upload-guid': idemUploadGuid
},
metadata: {
filename: file.name,
filetype: file.type,
authorIdemGuid: idemGuid
}
}).start();
Exchange
GET /api_public/exchange/exchange_get_user_state
Auth: ExchangeApiKey — idem_api_token (query)
Returns the state of the authenticated user.
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
POST /api_public/exchange/exchange_insert_order
Auth: ExchangeApiKey — idem_api_token (query)
Request Body
application/json
| Field | Type | Description |
|---|
action required | string | Order side — bid (buy) or ask (sell). Allowed values: bid, ask |
currency_pair_guid | string | Required if currency_pair_symbol is not sent. |
currency_pair_symbol | string | Required if currency_pair_guid is not sent. |
amount required | number | |
price required | number | |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
POST /api_public/exchange/exchange_cancel_order
Auth: ExchangeApiKey — idem_api_token (query)
Request Body
application/json
| Field | Type | Description |
|---|
currency_pair_symbol required | string | |
order_id required | string | |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
GET /api_public/exchange/exchange_get_order_book
Auth: ExchangeApiKey — idem_api_token (query)
Parameters
| Parameter | In | Type | Description |
|---|
currency_pair_symbol required | query | string | |
depth | query | integer | Optional. Order book depth. Default: 100 · Min: 1 · Max: 100 |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
GET /api_public/exchange/exchange_get_order_list
Auth: ExchangeApiKey — idem_api_token (query)
Parameters
| Parameter | In | Type | Description |
|---|
currency_pair_symbol required | query | string | |
timestamp required | query | integer | Unix timestamp in seconds. |
limit | query | integer | Optional. Maximum number of results to return. Default: 100 · Min: 1 · Max: 100 |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
GET /api_public/exchange/exchange_get_trade_list
Auth: ExchangeApiKey — idem_api_token (query)
Parameters
| Parameter | In | Type | Description |
|---|
currency_pair_symbol required | query | string | |
timestamp | query | integer | Optional. Unix timestamp in seconds. Defaults to the current time (time()). |
limit | query | integer | Optional. Maximum number of results to return. Default: 30 · Min: 1 · Max: 100 |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
GET /api_public/exchange/exchange_get_currency_pair_stat
Auth: ExchangeApiKey — idem_api_token (query)
Parameters
| Parameter | In | Type | Description |
|---|
currency_pair_symbol required | query | string | |
time_frame required | query | M1 | M5 | M15 | H1 | H4 | D1 | W1 | Stat period. |
Responses
HTTP 200
Always HTTP 200. Check the body to tell success from failure — see the "Response envelope" note above.
application/json
Success
Returned when the request succeeds. The HTTP status code is 200. status is optional — a response may include it as true/"success", or omit it and return the requested data directly as the response body.
| Field | Type | Description |
|---|
status | boolean | string | Marks a success response. Sent as boolean true or string "success" — this field may also be absent entirely, with the response body just being the requested data (see SuccessResponse). Allowed values: true, success |
or
Error
Returned when the request fails. The HTTP status code is still 200.
| Field | Type | Description |
|---|
status required | boolean | string | Marks an error response. Sent as boolean false or string "fail". Allowed values: false, fail |
code | integer | Optional. Present only when the error is a handled exception. Allowed values: 10, 30, 50, 202, 203, 204, 205, 252, 253, 270, 280, 1000, 1001 |
result_error | array | Optional. Extra information about the error. array of object:
One error detail entry. Usually carries message, but it is optional; other fields may be included depending on the error. | Field | Type | Description |
|---|
message | string | |
|
Chat Socket
WEBSOCKET wss://chat.tangled.com/chat/socket
Real-time chat over WebSocket. Open a WebSocket connection to wss://chat.tangled.com/chat/socket. Note that this is a different host than the REST API, and that the rest of this document does not apply to it: there is no idem_api_token query parameter and no status envelope. The messages you can send and receive are listed below, under the connection.
Authentication
Right after connecting, send INITIALIZE_SESSION with an application API key as idemApiToken. The server confirms with INITIALIZE_SESSION_RESULT, wait for it before sending anything else.
Message format
Every frame, in both directions, is a JSON text with a type and an optional payload object: {"type":"PING"} or {"type":"JOIN_CHAT_ROOM_PUBLIC","payload":{"chatRoomGuid":"...","connString":"..."}}.
- Payload keys are documented in camelCase, which is what the server sends. Keys of the payload you send are converted to camelCase, so
chat_room_guid works too. Only top level keys are converted. - Most requests have no direct response. If a required field is missing the request is dropped silently, without an error.
- Unknown message types are ignored. A frame that is not valid JSON, or that fails while being processed, is answered with ERROR.
connString values are opaque. Send them back exactly as the server gave them.
Keepalive
Send PING from time to time, the server answers with PONG.
Live messages and observed rooms
A connection receives CHAT_ROOM_MESSAGE and CHAT_ROOM_IDEM_MUTE_STATUS only for rooms it observes.
- A room becomes observed after
JOIN_CHAT_ROOM_PUBLIC, after GET_CHAT_ROOM_LIST_SUMMARY (all returned rooms), after creating a room with UPSERT_CHAT_ROOM, and when the user's status in a room is set to WATCH. - A room stops being observed after
LEAVE_CHAT_ROOM_PUBLIC, when the user's status is set to IGNORE or DELETE, or when a moderator deletes the user from the room. - The list of observed rooms belongs to the connection, so after a reconnect the rooms have to be joined again.
Error codes
Responses
HTTP 101
Switching Protocols. The connection is now a WebSocket.
Messages you send
Authenticate the connection
Authenticates the connection with an API key. Must be the first message. The server answers with INITIALIZE_SESSION_RESULT.
Payload
| Field | Type | Description |
|---|
idemApiToken required | string | API key with type application. |
Server replies with
Example
{
"type": "INITIALIZE_SESSION",
"payload": {
"idemApiToken": "YOUR_API_KEY"
}
}Keepalive
Keepalive. The server answers with PONG.
Payload
No payload.
Server replies with
Example
{
"type": "PING"
}Join a public room
Starts observing a room, so its new messages are pushed to the connection as CHAT_ROOM_MESSAGE. Only rooms of type ROOM_PUBLIC_OFFICIAL, ROOM_CONTENT and ROOM_GROUP can be joined this way, any other type is ignored. On success the server answers with CHAT_ROOM_SUMMARY (the room and its latest messages). If chatRoomGuid or connString is missing, nothing happens.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
Server replies with
Example
{
"type": "JOIN_CHAT_ROOM_PUBLIC",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING"
}
}Leave a public room
Stops observing a room. No response.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
Example
{
"type": "LEAVE_CHAT_ROOM_PUBLIC",
"payload": {
"chatRoomGuid": "ROOM_GUID"
}
}Send a message to a room
Posts a message to a room as the connected user. The message is delivered as CHAT_ROOM_MESSAGE to every connection observing the room, the sender's included, so there is no separate confirmation. If the user is muted in the room, the message is dropped and the server answers with CHAT_ROOM_MESSAGE_REJECTED.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
chatRoomMessage required | any | or QuillDelta Quill.js delta object, e.g. {"ops":[{"insert":"test"}]}. | Field | Type | Description |
|---|
ops required | array | array of object
|
|
connString required | string | |
Server replies with
Example
{
"type": "CHAT_ROOM_MESSAGE_SEND",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"chatRoomMessage": "hello",
"connString": "ROOM_CONN_STRING"
}
}Load messages of a room
Loads a page of messages of a room, used for scrolling back in history. The server answers with CHAT_ROOM_MESSAGE_LIST. If chatRoomGuid or connString is missing, nothing happens. Limit predefined as 50.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
offset | integer | Optional. Pagination offset. Default: 0 · Min: 0 |
Server replies with
Example
{
"type": "GET_CHAT_ROOM_MESSAGE_LIST",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING",
"offset": 0
}
}Load the rooms of the user
Loads the rooms of the connected user with their latest messages. The server answers with CHAT_ROOM_LIST_SUMMARY. Every returned room becomes observed by the connection.
Payload
No payload.
Server replies with
Example
{
"type": "GET_CHAT_ROOM_LIST_SUMMARY"
}Create or update a room
Creates a room, or updates an existing one when chatRoomGuid is sent.
- When creating, the connected user is added to
idemGuidList automatically, all members get the WATCH status, and the room becomes observed by the connection. - For
CONVERSATION_PRIVATE rooms chatRoomName is ignored, the name is generated from the idem_guids of the members, so the same set of users always gets the same room. idemGuidList is required for this type.
The server answers with CHAT_ROOM_SUMMARY. When socketMessageRequestGuid is sent, it is echoed back in that response.
Payload
| Field | Type | Description |
|---|
chatRoomGuid | string | Optional. Send it to update an existing room, omit it to create a new one. |
connString | string | Send it together with chatRoomGuid when updating. |
chatRoomTypeGuid required | string | Values of chatRoomTypeGuid.
yOfsJeuRv = ROOM_PUBLIC_OFFICIALOTNdx8LTY = ROOM_PUBLICgPoNbrB4H = ROOM_CONTENTWCGobOEHL = ROOM_GROUPNg82cDrhG = CONVERSATION_PRIVATE1gXRppWqW = ROOM_PRIVATE
Allowed values: yOfsJeuRv, OTNdx8LTY, gPoNbrB4H, WCGobOEHL, Ng82cDrhG, 1gXRppWqW |
chatRoomName | string | |
idemGuidList | array | idem_guids of the users to add to the room. Required when creating a room. array of string
|
socketMessageRequestGuid | string | Optional. Any string, echoed back in the response so it can be matched to this request. |
Server replies with
Example
{
"type": "UPSERT_CHAT_ROOM",
"payload": {
"chatRoomTypeGuid": "Ng82cDrhG",
"idemGuidList": [
"OTHER_USER_IDEM_GUID"
],
"socketMessageRequestGuid": "any-string-you-like"
}
}Mark a room as read
Marks a room as read up to a point in time. No response. If a required field is missing or lastReadTimestamp is 0, nothing happens.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
lastReadTimestamp required | integer | Unix timestamp in milliseconds. |
chatRoomMessageGuid | string | Optional. The last message that was read. |
Example
{
"type": "UPDATE_CHAT_ROOM_LAST_READ_TIMESTAMP",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING",
"lastReadTimestamp": 1790000000000
}
}Set an attribute of the user
Sets an attribute of the connected user. No response. Only the attributes listed below are accepted, the format of value depends on the attribute.
61E4cq62t = IDEM_ATTRIBUTE_TYPE_GUID_CHAT_NOTIFICATION_VOLUME — value is an integer between 0 and 100.hXlYZecZe = IDEM_ATTRIBUTE_TYPE_GUID_CHAT_ROOM_LIST_PINNED — value is an array of chatRoomGuid.
Payload
| Field | Type | Description |
|---|
attributeTypeGuid required | string | Allowed values: 61E4cq62t, hXlYZecZe |
value required | any | integer For 61E4cq62t (chat notification volume). Min: 0 · Max: 100 or array For hXlYZecZe (pinned chat rooms). List of chatRoomGuid. array of string
|
Example
{
"type": "UPSERT_IDEM_ATTRIBUTE",
"payload": {
"attributeTypeGuid": "hXlYZecZe",
"value": [
"ROOM_GUID_1",
"ROOM_GUID_2"
]
}
}Change your own status in a room
Changes the connected user's own status in a room, for example accepting an invitation, ignoring or leaving the room. No response. Ignored when chatRoomIdemRelationshipGuid is missing.
WATCH starts observing the room on this connection.IGNORE and DELETE stop observing it.
Payload
| Field | Type | Description |
|---|
chatRoomIdemRelationshipGuid required | string | |
chatRoomGuid required | string | |
connString required | string | |
relationshipStatus required | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 |
Example
{
"type": "UPDATE_IDEM_CHAT_ROOM_IDEM_RELATIONSHIP",
"payload": {
"chatRoomIdemRelationshipGuid": "RELATIONSHIP_GUID",
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING",
"relationshipStatus": 100
}
}Add several users to a room
Adds several users to a room at once, for example as invitations. The room must be observed by the connection, otherwise nothing happens. The server answers with CHAT_ROOM_IDEM_RELATIONSHIP_LIST.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
relationshipTypeGuid required | string | Values of relationshipTypeGuid.
FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr = ROOM_MODERATORcjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l = ROOM_FILTER_IDEM0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL = IDEM_FILTER_ROOM
Allowed values: FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr, cjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l, 0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL |
relationshipStatus required | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 |
idemGuidList required | array | array of string
|
Server replies with
Example
{
"type": "INSERT_CHAT_ROOM_IDEM_RELATIONSHIP_BULK",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING",
"relationshipTypeGuid": "0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL",
"relationshipStatus": 1,
"idemGuidList": [
"USER_IDEM_GUID"
]
}
}Change the status of another user in a room
Changes the relationship of another user with a room (moderation). The room must be observed by the connection and chatRoomIdemRelationshipGuid must be sent, otherwise nothing happens. Whether the connected user is allowed to do it is checked by the backend. No response. When the status is DELETE, the connections of that user stop observing the room.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
idemGuid required | string | idem_guid of the user being moderated. |
chatRoomIdemRelationshipGuid required | string | |
relationshipTypeGuid required | string | Values of relationshipTypeGuid.
FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr = ROOM_MODERATORcjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l = ROOM_FILTER_IDEM0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL = IDEM_FILTER_ROOM
Allowed values: FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr, cjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l, 0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL |
relationshipStatus required | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 |
Example
{
"type": "MODERATOR_UPSERT_CHAT_ROOM_IDEM_RELATIONSHIP"
}Mute or unmute a user in a room
Mutes or unmutes a user in a room. Only the room owner can do it (for a live stream chat, the host of the live stream), and the owner cannot mute themselves, anything else is ignored silently. A muted user gets CHAT_ROOM_MESSAGE_REJECTED when sending a message. No direct response.
Payload
| Field | Type | Description |
|---|
chatRoomGuid required | string | |
connString required | string | |
idemGuid required | string | idem_guid of the user to mute or unmute. |
isMuted required | boolean | true to mute, false to unmute.
|
Example
{
"type": "UPSERT_CHAT_ROOM_IDEM_MUTE_STATUS",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"connString": "ROOM_CONN_STRING",
"idemGuid": "USER_IDEM_GUID",
"isMuted": true
}
}Get or create the room of an object
Returns the chat room bound to an object (a content or an idem), creating it if it does not exist yet. The server answers with CHAT_ROOM. If the room could not be found or created, there is no response.
OBJECT_GUID_CONTENT — objectKey is the content_guid, and connString is required.OBJECT_GUID_IDEM — objectKey is the idem_guid.
Payload
| Field | Type | Description |
|---|
objectGuid required | string | Subset of ObjectGuid accepted as objectGuid by GET_OR_UPSERT_CHAT_ROOM_BY_OBJECT.
VgdQ75fSR = OBJECT_GUID_CONTENTIuHltsyvV = OBJECT_GUID_IDEM
Allowed values: VgdQ75fSR, IuHltsyvV |
objectKey required | string | content_guid when objectGuid = OBJECT_GUID_CONTENTidem_guid when objectGuid = OBJECT_GUID_IDEM
|
connString | string | Required when objectGuid = OBJECT_GUID_CONTENT. The conn_content of the content record. |
Server replies with
Example
{
"type": "GET_OR_UPSERT_CHAT_ROOM_BY_OBJECT",
"payload": {
"objectGuid": "VgdQ75fSR",
"objectKey": "CONTENT_GUID",
"connString": "CONTENT_CONN_STRING"
}
} Messages you receive
Session is ready
Sent whenever the session of the connection is resolved or changes, for example after INITIALIZE_SESSION. It only confirms whether the user is logged in, it does not carry any information about the user.
Payload
| Field | Type | Description |
|---|
sessionData | object | Session of the connected user. It only confirms the login state, it does not describe the user. | Field | Type | Description |
|---|
idemGuid | string | | isLoggedIn required | boolean | true if the user is logged in.
|
|
Sent in reply to
Example
{
"type": "INITIALIZE_SESSION_RESULT",
"payload": {
"sessionData": {
"idemGuid": "vnZ6mNgEv1LWrDB4bLnceSwIVpCpXAiE",
"isLoggedIn": true
}
}
}Answer to PING
Payload
No payload.
Sent in reply to
Example
{
"type": "PONG"
}Invalid frame
Sent when a frame is not valid JSON or fails while being processed. Unknown message types do not produce an error, they are ignored.
Payload
| Field | Type | Description |
|---|
errorMessage | string | Currently always the payload received is invalid. |
Example
{
"type": "ERROR",
"payload": {
"errorMessage": "the payload received is invalid"
}
}A room with its latest messages
A room with its latest messages. Sent after JOIN_CHAT_ROOM_PUBLIC and UPSERT_CHAT_ROOM. For a room that was only updated the lists are empty.
Payload
| Field | Type | Description |
|---|
chatRoom | object | | Field | Type | Description |
|---|
chatRoomGuid | string | | chatRoomName | string | | chatRoomNameShort | string | | chatRoomDescription | string | | chatRoomTypeGuid | string | Values of chatRoomTypeGuid.
yOfsJeuRv = ROOM_PUBLIC_OFFICIALOTNdx8LTY = ROOM_PUBLICgPoNbrB4H = ROOM_CONTENTWCGobOEHL = ROOM_GROUPNg82cDrhG = CONVERSATION_PRIVATE1gXRppWqW = ROOM_PRIVATE
Allowed values: yOfsJeuRv, OTNdx8LTY, gPoNbrB4H, WCGobOEHL, Ng82cDrhG, 1gXRppWqW | chatRoomPrivate | integer | | chatRoomObscenity | integer | | languageGuid | string | | countryGuid | string | | idemGuidOwner | string | idem_guid of the room owner. | objectGuid | string | | objectKey | string | | updateDate | string | | connString | string | Opaque connection string of the room. Send it back unchanged as connString in requests about this room. | status | integer | | createDate | string | |
|
messageList | array | array of object:
| Field | Type | Description |
|---|
chatRoomMessageGuid | string | | chatRoomGuid | string | | idemGuid | string | | chatRoomMessage | any | or QuillDelta Quill.js delta object, e.g. {"ops":[{"insert":"test"}]}. | Field | Type | Description |
|---|
ops required | array | array of object
|
| chatRoomMessageDate | integer | Unix timestamp in milliseconds. | connString | string | Opaque connection string of the room. | status | integer | | createDate | string | null | |
|
idemDetailList | array | Details of the authors of the messages, and of the members when the room was just created. array of object:
Public details of an idem (user or group) that appears in a chat. |
chatRoomIdemRelationshipList | array | Filled only when the room was just created. array of object:
Relationship between an idem and a chat room (membership, invitation, moderation). | Field | Type | Description |
|---|
chatRoomIdemRelationshipGuid | string | | chatRoomGuid | string | | idemGuid | string | | idemGuidModerator | string | | relationshipTypeGuid | string | Values of relationshipTypeGuid.
FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr = ROOM_MODERATORcjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l = ROOM_FILTER_IDEM0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL = IDEM_FILTER_ROOM
Allowed values: FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr, cjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l, 0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL | relationshipStatus | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 | expiration | integer | | lastReadTimestamp | integer | | connString | string | Opaque connection string of the room. | status | integer | | updateDate | string | | createDate | string | | unreadMessageCount | integer | |
|
mutedIdemGuidList | array | idem_guids muted in the room. Filled only when the connected user is the owner of the room, otherwise empty. array of string
|
socketMessageRequestGuid | string | Present only when it was sent in UPSERT_CHAT_ROOM. |
Sent in reply to
Example
{
"type": "CHAT_ROOM_SUMMARY"
}A room
Answer to GET_OR_UPSERT_CHAT_ROOM_BY_OBJECT. Only the room record is sent, without messages or members. If the room could not be found or created, nothing is sent.
Payload
| Field | Type | Description |
|---|
chatRoom | object | | Field | Type | Description |
|---|
chatRoomGuid | string | | chatRoomName | string | | chatRoomNameShort | string | | chatRoomDescription | string | | chatRoomTypeGuid | string | Values of chatRoomTypeGuid.
yOfsJeuRv = ROOM_PUBLIC_OFFICIALOTNdx8LTY = ROOM_PUBLICgPoNbrB4H = ROOM_CONTENTWCGobOEHL = ROOM_GROUPNg82cDrhG = CONVERSATION_PRIVATE1gXRppWqW = ROOM_PRIVATE
Allowed values: yOfsJeuRv, OTNdx8LTY, gPoNbrB4H, WCGobOEHL, Ng82cDrhG, 1gXRppWqW | chatRoomPrivate | integer | | chatRoomObscenity | integer | | languageGuid | string | | countryGuid | string | | idemGuidOwner | string | idem_guid of the room owner. | objectGuid | string | | objectKey | string | | updateDate | string | | connString | string | Opaque connection string of the room. Send it back unchanged as connString in requests about this room. | status | integer | | createDate | string | |
|
Sent in reply to
Example
{
"type": "CHAT_ROOM"
}New message in a room
A new message in a room observed by the connection. The author receives it too.
Payload
| Field | Type | Description |
|---|
chatRoomMessage | object | | Field | Type | Description |
|---|
chatRoomMessageGuid | string | | chatRoomGuid | string | | idemGuid | string | | chatRoomMessage | any | or QuillDelta Quill.js delta object, e.g. {"ops":[{"insert":"test"}]}. | Field | Type | Description |
|---|
ops required | array | array of object
|
| chatRoomMessageDate | integer | Unix timestamp in milliseconds. | connString | string | Opaque connection string of the room. | status | integer | | createDate | string | null | |
|
idemDetail | object | |
Sent in reply to
Example
{
"type": "CHAT_ROOM_MESSAGE"
}Page of messages
Answer to GET_CHAT_ROOM_MESSAGE_LIST. The payload does not repeat the room guid, take it from the messages.
Payload
| Field | Type | Description |
|---|
messageList | array | array of object:
| Field | Type | Description |
|---|
chatRoomMessageGuid | string | | chatRoomGuid | string | | idemGuid | string | | chatRoomMessage | any | or QuillDelta Quill.js delta object, e.g. {"ops":[{"insert":"test"}]}. | Field | Type | Description |
|---|
ops required | array | array of object
|
| chatRoomMessageDate | integer | Unix timestamp in milliseconds. | connString | string | Opaque connection string of the room. | status | integer | | createDate | string | null | |
|
idemDetailList | array | array of object:
Public details of an idem (user or group) that appears in a chat. |
Sent in reply to
Example
{
"type": "CHAT_ROOM_MESSAGE_LIST"
}Rooms of the user
Answer to GET_CHAT_ROOM_LIST_SUMMARY.
Payload
| Field | Type | Description |
|---|
chatRoomList | array | array of object:
| Field | Type | Description |
|---|
chatRoomGuid | string | | chatRoomName | string | | chatRoomNameShort | string | | chatRoomDescription | string | | chatRoomTypeGuid | string | Values of chatRoomTypeGuid.
yOfsJeuRv = ROOM_PUBLIC_OFFICIALOTNdx8LTY = ROOM_PUBLICgPoNbrB4H = ROOM_CONTENTWCGobOEHL = ROOM_GROUPNg82cDrhG = CONVERSATION_PRIVATE1gXRppWqW = ROOM_PRIVATE
Allowed values: yOfsJeuRv, OTNdx8LTY, gPoNbrB4H, WCGobOEHL, Ng82cDrhG, 1gXRppWqW | chatRoomPrivate | integer | | chatRoomObscenity | integer | | languageGuid | string | | countryGuid | string | | idemGuidOwner | string | idem_guid of the room owner. | objectGuid | string | | objectKey | string | | updateDate | string | | connString | string | Opaque connection string of the room. Send it back unchanged as connString in requests about this room. | status | integer | | createDate | string | |
|
chatRoomIdemRelationshipList | array | array of object:
Relationship between an idem and a chat room (membership, invitation, moderation). | Field | Type | Description |
|---|
chatRoomIdemRelationshipGuid | string | | chatRoomGuid | string | | idemGuid | string | | idemGuidModerator | string | | relationshipTypeGuid | string | Values of relationshipTypeGuid.
FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr = ROOM_MODERATORcjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l = ROOM_FILTER_IDEM0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL = IDEM_FILTER_ROOM
Allowed values: FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr, cjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l, 0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL | relationshipStatus | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 | expiration | integer | | lastReadTimestamp | integer | | connString | string | Opaque connection string of the room. | status | integer | | updateDate | string | | createDate | string | | unreadMessageCount | integer | |
|
messageList | array | Latest messages of the rooms. array of object:
| Field | Type | Description |
|---|
chatRoomMessageGuid | string | | chatRoomGuid | string | | idemGuid | string | | chatRoomMessage | any | or QuillDelta Quill.js delta object, e.g. {"ops":[{"insert":"test"}]}. | Field | Type | Description |
|---|
ops required | array | array of object
|
| chatRoomMessageDate | integer | Unix timestamp in milliseconds. | connString | string | Opaque connection string of the room. | status | integer | | createDate | string | null | |
|
idemDetailList | array | array of object:
Public details of an idem (user or group) that appears in a chat. |
Sent in reply to
Example
{
"type": "CHAT_ROOM_LIST_SUMMARY"
}Relationships that were created
Answer to INSERT_CHAT_ROOM_IDEM_RELATIONSHIP_BULK. Not sent when no relationship was created.
Payload
| Field | Type | Description |
|---|
chatRoomIdemRelationshipList | array | array of object:
Relationship between an idem and a chat room (membership, invitation, moderation). | Field | Type | Description |
|---|
chatRoomIdemRelationshipGuid | string | | chatRoomGuid | string | | idemGuid | string | | idemGuidModerator | string | | relationshipTypeGuid | string | Values of relationshipTypeGuid.
FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr = ROOM_MODERATORcjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l = ROOM_FILTER_IDEM0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL = IDEM_FILTER_ROOM
Allowed values: FIp4HkYLBUCKQncpY15nvuUm1QVdMcVr, cjIXh6j3OWDgHFw8jr6z29rOgy3R9R3l, 0EPq8fbHsGuzHaCrqjAPCE1jyxRLKxSL | relationshipStatus | integer | Values of relationshipStatus.
100 = WATCH, the user is a member and follows the room1 = INVITATION, the user is invited and has not answered yet0 = IGNORE-1 = DELETE
Allowed values: 100, 1, 0, -1 | expiration | integer | | lastReadTimestamp | integer | | connString | string | Opaque connection string of the room. | status | integer | | updateDate | string | | createDate | string | | unreadMessageCount | integer | |
|
idemDetailList | array | array of object:
Public details of an idem (user or group) that appears in a chat. |
Sent in reply to
Example
{
"type": "CHAT_ROOM_IDEM_RELATIONSHIP_LIST"
}A user was muted or unmuted
A user was muted or unmuted in a room observed by the connection.
Payload
| Field | Type | Description |
|---|
chatRoomGuid | string | |
idemGuid | string | |
isMuted | boolean | |
Example
{
"type": "CHAT_ROOM_IDEM_MUTE_STATUS"
}Message was not posted
A CHAT_ROOM_MESSAGE_SEND was refused and the message was not posted.
Payload
| Field | Type | Description |
|---|
chatRoomGuid | string | |
code | integer | 100 = ERR_CODE_CHAT_ROOM_IDEM_MUTED, the user is muted in this room.
Allowed values: 100 |
Sent in reply to
Example
{
"type": "CHAT_ROOM_MESSAGE_REJECTED",
"payload": {
"chatRoomGuid": "ROOM_GUID",
"code": 100
}
}