Appearance
Discussion
Discussions and messages: send, edit, load, and manage discussion membership.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v3.discussion.close | discussionId: string | boolean |
v3.discussion.files | discussionId: string, options?: { limit?: number, skip?: number, search?: string, reverse?: boolean, sortBy?: string } | object |
v3.discussion.markUnread | messageId: string | boolean |
v3.discussion.message.collapsed.list | { discussionId: string, messageIds: string[] } | object |
v3.discussion.message.focus | messageId: string | object |
v3.discussion.message.get | messageId: string | object |
v3.discussion.message.latest | discussionId: string, options?: { collapsed?: boolean } | object |
v3.discussion.message.next | messageId: string, options?: { collapsed?: boolean } | object |
v3.discussion.message.previous | messageId: string, options?: { collapsed?: boolean } | object |
v3.discussion.message.star | messageId: string | boolean |
v3.discussion.message.stars | discussionIds?: string[] | array |
v3.discussion.setPermission | permissions: { discussionId: string, userId: string, permits: string[] } | boolean |
v3.discussion.touch | discussionIds: string[] | discussionId[] |
v3.discussion.close
Description
Close/open discussion.
Parameters
Argument 1 (ObjectId, required): discussionId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.close', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.files
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (discussionId, required): discussionId
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
limit | number | no | |
skip | number | no | |
search | string | no | |
reverse | boolean | no | |
sortBy | string | no |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.files', [
'507f1f77bcf86cd799439011', // discussionId (required)
{
limit: 0,
skip: 0,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
total | number | yes | |
files | object[] | yes | See below. |
allLoaded | boolean | yes |
files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.markUnread
Description
Mark a message and all subsequent messages as unread
Parameters
Argument 1 (ObjectId, required): messageId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.markUnread', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.collapsed.list
Description
Expand a collapsed marker. Returns the hydrated real messages for the given message ids (the marker's meta.messageIds). Re-applies the same participant + read-history authorization as message loading, so client-supplied ids are never trusted.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
discussionId | discussionId | yes | Discussion id |
messageIds | ObjectId[] | yes | Collapsed message ids to expand |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.collapsed.list', [
{
discussionId: '507f1f77bcf86cd799439011', // Discussion id
messageIds: ['507f1f77bcf86cd799439011'], // Collapsed message ids to expand
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.focus
Description
Load 100 messages around specified message
Parameters
Argument 1 (ObjectId, required): messageId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.focus', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.get
Description
Load specified message
Parameters
Argument 1 (ObjectId, required): messageId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.get', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.latest
Description
Load 50 latest messages from specified discussion Pass { collapsed: true } to coalesce system-message runs
Parameters
Argument 1 (discussionId, required): discussionId
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
collapsed | boolean | no |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.latest', [
'507f1f77bcf86cd799439011', // discussionId (required)
{
collapsed: false,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.next
Description
Load 50 newer messages than specified message Pass { collapsed: true } to coalesce system-message runs
Parameters
Argument 1 (ObjectId, required): messageId
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
collapsed | boolean | no |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.next', [
'507f1f77bcf86cd799439011', // ObjectId (required)
{
collapsed: false,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.previous
Description
Load 50 older messages than specified message Pass { collapsed: true } to coalesce system-message runs
Parameters
Argument 1 (ObjectId, required): messageId
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
collapsed | boolean | no |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.previous', [
'507f1f77bcf86cd799439011', // ObjectId (required)
{
collapsed: false,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
newestLoaded | boolean | no | |
oldestLoaded | boolean | no | |
messages | object[] | no | See below. |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
messages[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Message id |
created | timestamp | yes | Timestamp of when the message was sent |
updated | timestamp | no | Timestamp of when the message was last updated |
removed | timestamp | no | Timestamp of when the message was deleted |
edited | timestamp | no | Timestamp of when the message last edited |
loc | object | no | Message location data |
from | userId | no | Sender user id |
uid | userId | no | Sender user id |
discussion | discussionId | no | Discussion id |
type | string | no | Type of the message One of: user, user.join, user.leave, activity.created, activity.updated, activity.removed, linked.activity.created, linked.activity.moved, event.new, event.updated, event.removed, event.going, event.notgoing, event.attend_response, discussion.invites, discussion.removesinvites, meet.start, meet.end, ball.passed, ball.passed_by, ball.taken, ball.cleared, ball.auto_assigned, collapsed. |
meta | string[] | object | string | no | Meta data of the message |
msg | string | no | The contents of the message |
tagged | object | no | |
_metas | object | no | See below. |
localIdentifier | string | no | |
replyTo | ObjectId | no | Id of the reply message |
replyMessage | object | no | Reply message |
reactions | Record<string, string[]> | no | Message user reactions |
stars | object[] | no | See below. |
isStarred | boolean | no | |
linkedData | array | no | |
scheduled | boolean | no | |
cid | WorkspaceId | no | workspaceId (former networkId) |
deleteAt | Date | no | Date after which the message should be automatically deleted (BSON Date for MongoDB TTL) |
forwardMessage | object | no | |
files | object[] | no | See below. |
messages[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<string, object> | no | See below. |
messages[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
messages[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
uid | userId | no | userId |
messages[].files[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
messages[].files[].dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.star
Description
Star/unstar a message
Parameters
Argument 1 (ObjectId, required): messageId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.star', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.message.stars
Description
Returns users starred messages
Parameters
Argument 1 (discussionId[], optional):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.message.stars', [
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
Array of any.
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.setPermission
Description
Set permits for user in a discussion
Parameters
Argument 1 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
discussionId | discussionId | no | discussionId |
userId | userId | no | userId |
permits | string[] | no | Array of role permits. |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.setPermission', [
{
discussionId: '507f1f77bcf86cd799439011', // discussionId
userId: '507f1f77bcf86cd799439011', // userId
},
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.
v3.discussion.touch
Description
Sets users last seen date for specified discussions
Parameters
Argument 1 (discussionId[], required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.discussion.touch', [
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
Array of discussionId.
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.