Skip to content

Discussion ​

Discussions and messages: send, edit, load, and manage discussion membership.

Endpoints ​

EndpointArgumentsReturns
v3.discussion.closediscussionId: stringboolean
v3.discussion.filesdiscussionId: string, options?: { limit?: number, skip?: number, search?: string, reverse?: boolean, sortBy?: string }object
v3.discussion.markUnreadmessageId: stringboolean
v3.discussion.message.collapsed.list{ discussionId: string, messageIds: string[] }object
v3.discussion.message.focusmessageId: stringobject
v3.discussion.message.getmessageId: stringobject
v3.discussion.message.latestdiscussionId: string, options?: { collapsed?: boolean }object
v3.discussion.message.nextmessageId: string, options?: { collapsed?: boolean }object
v3.discussion.message.previousmessageId: string, options?: { collapsed?: boolean }object
v3.discussion.message.starmessageId: stringboolean
v3.discussion.message.starsdiscussionIds?: string[]array
v3.discussion.setPermissionpermissions: { discussionId: string, userId: string, permits: string[] }boolean
v3.discussion.touchdiscussionIds: 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):

FieldTypeRequiredDescription
limitnumberno
skipnumberno
searchstringno
reversebooleanno
sortBystringno

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

FieldTypeRequiredDescription
totalnumberyes
filesobject[]yesSee below.
allLoadedbooleanyes

files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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):

FieldTypeRequiredDescription
discussionIddiscussionIdyesDiscussion id
messageIdsObjectId[]yesCollapsed 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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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):

FieldTypeRequiredDescription
collapsedbooleanno

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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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):

FieldTypeRequiredDescription
collapsedbooleanno

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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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):

FieldTypeRequiredDescription
collapsedbooleanno

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

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId

messages[] (object):

FieldTypeRequiredDescription
_idObjectIdyesMessage id
createdtimestampyesTimestamp of when the message was sent
updatedtimestampnoTimestamp of when the message was last updated
removedtimestampnoTimestamp of when the message was deleted
editedtimestampnoTimestamp of when the message last edited
locobjectnoMessage location data
fromuserIdnoSender user id
uiduserIdnoSender user id
discussiondiscussionIdnoDiscussion id
typestringnoType 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.
metastring[] | object | stringnoMeta data of the message
msgstringnoThe contents of the message
taggedobjectno
_metasobjectnoSee below.
localIdentifierstringno
replyToObjectIdnoId of the reply message
replyMessageobjectnoReply message
reactionsRecord<string, string[]>noMessage user reactions
starsobject[]noSee below.
isStarredbooleanno
linkedDataarrayno
scheduledbooleanno
cidWorkspaceIdnoworkspaceId (former networkId)
deleteAtDatenoDate after which the message should be automatically deleted (BSON Date for MongoDB TTL)
forwardMessageobjectno
filesobject[]noSee below.

messages[]._metas (object):

FieldTypeRequiredDescription
filesRecord<string, object>noSee below.

messages[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

messages[].stars[] (object):

FieldTypeRequiredDescription
creatednumberno
uiduserIdnouserId

messages[].files[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

messages[].files[].dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

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):

FieldTypeRequiredDescription
discussionIddiscussionIdnodiscussionId
userIduserIdnouserId
permitsstring[]noArray 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.

Hailer Developer Documentation · v1.8.0