Skip to content

Forms ​

Internal

These endpoints are internal to Hailer and not part of the supported public API.

Public forms: render a workflow form, create activities from submissions, and search.

Endpoints ​

EndpointArgumentsReturns
v2.forms.activities.searchkey: string, fieldId: string, searchStr: stringobject[]
v2.forms.activity.createkey: string, activityData: { files?: string[], history?: any, name?: string, location?: boolean | object, uid?: string }unknown
v2.forms.activity.phase.getoptions: { key: string, activityId: string }object
v2.forms.discussion.rendereddiscussionToken: string, requestOptions: { messageId?: string, nextMessageCount?: number, previousMessageCount?: number, includeFocusMessage?: boolean }object
v2.forms.message.senddiscussionToken: string, message: stringunknown
v2.forms.process.getkey: stringunknown

Description

List activities of all processes/datasets pointed at from process/dataset where the forms key is activated

Parameters

Argument 1 (string, required): Form key

Argument 2 (ObjectId, required): FieldId

Argument 3 (string, optional): Search string

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('v2.forms.activities.search', [
  'string', // Form key (required)
  '507f1f77bcf86cd799439011', // ObjectId (required)
  'string', // Search string
]);
console.log(result);

Returns

Array of objects:

FieldTypeRequiredDescription
_idactivityIdyesactivityId
namestringno
processprocessIdyesworkflowId
currentPhasephaseIdyesphaseId (phase in a Workflow)

Auth: callable without authentication.

Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.forms.activity.create ​

Description

Create activity using form key. Return created activity

Parameters

Argument 1 (string, required): Form key

Argument 2 (object, required):

FieldTypeRequiredDescription
filesObjectId[]no
historyanyno
namestringno
locationboolean | objectno
uidObjectIdno

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('v2.forms.activity.create', [
  'string', // Form key (required)
  {
    files: ['507f1f77bcf86cd799439011'],
    history: '...',
  },
]);
console.log(result);

Returns

Undocumented

The return value is not described in the source yet.

Auth: callable without authentication.

Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.forms.activity.phase.get ​

Description

Returns current phase name for activity

Parameters

Argument 1 (object, optional):

FieldTypeRequiredDescription
keystringyesForm key
activityIdObjectIdyesActivity Id

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('v2.forms.activity.phase.get', [
  {
    key: 'string', // Form key
    activityId: '507f1f77bcf86cd799439011', // Activity Id
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
namestringyes

Auth: callable without authentication.

Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.forms.discussion.rendered ​

Description

Load messages of a discussion using a secret discussion token along with activity information and name mappings. Workspace-scoped files are left out of message and activity attachments: the token holder has no workspace standing.

Parameters

Argument 1 (string, required): Discussion token

Argument 2 (Options to pass to core.discussionV3.loadMessages when getting messages, optional):

FieldTypeRequiredDescription
messageIdObjectIdnomessageId
nextMessageCountnumberno
previousMessageCountnumberno
includeFocusMessagebooleanno

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('v2.forms.discussion.rendered', [
  'string', // Discussion token (required)
  {
    messageId: '507f1f77bcf86cd799439011', // messageId
    nextMessageCount: 0,
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
newestLoadedbooleanno
oldestLoadedbooleanno
messagesobject[]noSee below.
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId
participantsRecord<string, string>no
activityanyno

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: callable without authentication.

Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.forms.message.send ​

Description

Send messages to a discussion using a secret discussion token

Parameters

Argument 1 (string, required): Discussion token

Argument 2 (string, 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('v2.forms.message.send', [
  'string', // Discussion token (required)
  'string', // argument 2
]);
console.log(result);

Returns

Undocumented

The return value is not described in the source yet.

Auth: callable without authentication.

Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.forms.process.get ​

Description

Load process/dataset details using form key

Parameters

Argument 1 (string, required): Form key

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('v2.forms.process.get', [
  'string', // Form key (required)
]);
console.log(result);

Returns

Undocumented

The return value is not described in the source yet.

Auth: callable without authentication.

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