Appearance
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
| Endpoint | Arguments | Returns |
|---|---|---|
v2.forms.activities.search | key: string, fieldId: string, searchStr: string | object[] |
v2.forms.activity.create | key: string, activityData: { files?: string[], history?: any, name?: string, location?: boolean | object, uid?: string } | unknown |
v2.forms.activity.phase.get | options: { key: string, activityId: string } | object |
v2.forms.discussion.rendered | discussionToken: string, requestOptions: { messageId?: string, nextMessageCount?: number, previousMessageCount?: number, includeFocusMessage?: boolean } | object |
v2.forms.message.send | discussionToken: string, message: string | unknown |
v2.forms.process.get | key: string | unknown |
v2.forms.activities.search
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:
| Field | Type | Required | Description |
|---|---|---|---|
_id | activityId | yes | activityId |
name | string | no | |
process | processId | yes | workflowId |
currentPhase | phaseId | yes | phaseId (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):
| Field | Type | Required | Description |
|---|---|---|---|
files | ObjectId[] | no | |
history | any | no | |
name | string | no | |
location | boolean | object | no | |
uid | ObjectId | 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('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):
| Field | Type | Required | Description |
|---|---|---|---|
key | string | yes | Form key |
activityId | ObjectId | yes | Activity 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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes |
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):
| Field | Type | Required | Description |
|---|---|---|---|
messageId | ObjectId | no | messageId |
nextMessageCount | number | no | |
previousMessageCount | number | no | |
includeFocusMessage | 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('v2.forms.discussion.rendered', [
'string', // Discussion token (required)
{
messageId: '507f1f77bcf86cd799439011', // messageId
nextMessageCount: 0,
},
]);
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 |
participants | Record<string, string> | no | |
activity | any | no |
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: 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.