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 }` |
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?, debug? }.
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?, debug? }.
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?, debug? }.
v2.forms.discussion.rendered
Description
Load messages of a discussion using a secret discussion token along with activity information and name mappings
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 | |
oldestCursor | ObjectId | no | messageId |
newestCursor | ObjectId | no | messageId |
participants | Record<string, string> | no | |
activity | any | no |
Auth: callable without authentication.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
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?, debug? }.
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?, debug? }.