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.create`key: string, activityData: { files?: string[], history?: any, name?: string, location?: booleanobject, uid?: string }`
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?, 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):

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?, debug? }.

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

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[]no
oldestCursorObjectIdnomessageId
newestCursorObjectIdnomessageId
participantsRecord<string, string>no
activityanyno

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? }.

Hailer Developer Documentation