Appearance
Activities
Original activity endpoints: create, update, load, search, follow, linked activities, and phase counts.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
activities.add_followers | activityId, unknown | unknown |
activities.create | - | unknown |
activities.files | ObjectId | any[] |
activities.follow | ObjectId | boolean |
activities.linked_from | ObjectId | activityId[] |
activities.linked_from_extended | ObjectId | object[] |
activities.load | ObjectId | object |
activities.phase_count | processId | unknown |
activities.remove | unknown | object |
activities.search | unknown, unknown, options | object[] |
activities.set_update | options | object |
activities.update | options | object |
activities.add_followers
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (activityId, required): activityId
Argument 2 (userId[], 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('activities.add_followers', [
'507f1f77bcf86cd799439011', // activityId (required)
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
Undocumented
The return value is not described in the source yet.
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.
activities.create
Description
This function will create an activity if given the appropriate parameter object. We strongly recommend you use v3.activity.create or v3.activity.createMany.
Parameters
Undocumented
This endpoint declares no argument schema in the source yet.
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('activities.create', []);
console.log(result);Returns
Undocumented
The return value is not described in the source yet.
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.
activities.files
Description
If provided with a valid activityId that the user has access to, it will list filesIds for all files attached to that activity.
Parameters
Argument 1 (ObjectId, required): A valid activityId
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('activities.files', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
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.
activities.follow
Description
Toggles follow state
Parameters
Argument 1 (ObjectId, 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('activities.follow', [
'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.
activities.linked_from
Description
When provided a valid activityId which the user has permissions to view, it will return an array containing activityIds for activities which link to the original activity.
If no such activities exist, it will return an empty array.
Parameters
Argument 1 (ObjectId, 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('activities.linked_from', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
Array of activityId.
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.
activities.linked_from_extended
Description
Much like linked_from this function takes in a valid activityId and returns all activities linked to it, in their full form. This means that the results are not just an array of other activityIds but rather an array containing Activity Objects with field information and content.
Parameters
Argument 1 (ObjectId, 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('activities.linked_from_extended', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
_id | activityId | yes | activityId |
name | string | no | |
processName | string | no | |
processId | processId | yes | workflowId |
process | processId | yes | workflowId |
phaseId | phaseId | yes | phaseId (phase in a Workflow) |
phaseName | string | no | |
primaryNumericField | number | no | |
primaryDateField | number | no | |
fields | object[] | no | See below. |
priority | number | no | |
processFields | Record<string, object> | no | See below. |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
fields[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
id | ObjectId | yes | |
type | string | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader. |
value | any | no |
processFields.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
editable | boolean | no | Enables editing for function fields |
placeholder | string | no | Placeholder text for label |
description | string | no | Description text for field |
data | (ObjectId | string)[] | no | List of allowable values for predefined options or process ids for linked activities |
unit | string | no | Unit - default to null (no unit) |
defaultTo | boolean | no | Enable default to given value in defaultValue |
defaultValue | string | no | Default value for field if defaultTo is enabled |
function | string | no | Javascript function code |
functionEnabled | boolean | no | Enable function |
functionVariables | Record<string, object | object[]> | no | |
reminderEnabled | boolean | no | Enable reminder |
modifier | object | no | field type modifiers See below. |
key | string | no | Field Key |
reminderSettings | object | no | See below. |
collapsedByDefault | boolean | no | Hides fields under subheader if enabled |
label | string | yes | Field label |
required | boolean | no | Require field to be given - defaults to false Default: false. |
type | string | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader. |
inviteToDiscussionOnChange | boolean | no | Only used for User fields. If true the user will be added to the activity discussion if they are not already in it. Default: false. |
_id | ObjectId | yes | |
created | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
uid | userId | no | userId |
processFields.*.modifier (object):
| Field | Type | Required | Description |
|---|---|---|---|
checkbox | boolean | no | |
file | boolean | no | |
link | boolean | no | |
activityFieldFilters | object[] | no | See below. |
matchAllFieldFilters | boolean | no | Set true if all activityFieldFilters must match |
quickAdd | object | no | See below. |
processFields.*.modifier.activityFieldFilters[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
targetWorkflowId | processId | yes | workflowId |
targetFieldId | fieldId | yes | fieldId |
sourceFieldId | string | no |
processFields.*.modifier.quickAdd (object):
| Field | Type | Required | Description |
|---|---|---|---|
targetFieldId | fieldId | yes | fieldId |
fieldIds | fieldId[] | no |
processFields.*.reminderSettings (object):
| Field | Type | Required | Description |
|---|---|---|---|
users | ObjectId[] | no | Users to Remind |
teams | ObjectId[] | no | Teams to Remind |
fields | ObjectId[] | no | User/Team Fields to Remind |
phases | ObjectId[] | no | Phases where the reminder is active |
activityOwner | boolean | yes | Should we remind the activity owner |
activityOwnerTeam | boolean | yes | Should we remind the activity owner team |
activityParticipants | boolean | yes | Should we remind the activity discussion participants |
reminderText | string | no | |
fieldOffset | object | no | Offset to add to field dates for reminders See below. |
processFields.*.reminderSettings.fieldOffset (object):
| Field | Type | Required | Description |
|---|---|---|---|
milliseconds | number | yes | Milliseconds to add/subtract from offset |
days | number | yes | Days to add/subtract from offset |
months | number | yes | Months to add/subtract from offset |
beforeOrAfter | before | after | yes | |
startOrEnd | start | end | no |
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.
activities.load
Description
When provided a valid activityId to which the user has access, will return the corresponding Activity.
Parameters
Argument 1 (ObjectId, 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('activities.load', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | |
process | processId | yes | workflowId |
followers | ObjectId[] | no | |
team_account | object | yes | See below. |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
uid | userId | yes | userId |
cid | WorkspaceId | yes | workspaceId (former networkId) |
completePhases | ObjectId[] | no | |
currentPhase | ObjectId | yes | |
discussion | ObjectId | yes | |
fields | Record<string, object> | no | Fields of activity, format of items is dependent on the configuration of the process given in process field. See below. |
files | any[] | no | |
location | object | no | See below. |
priority | number | no | |
active | boolean | no | Activity not in endpoint phase is considered active |
links | object[] | no | See below. |
sequence | number | no | |
ballHolder | object | no | See below. |
team_account (object):
| Field | Type | Required | Description |
|---|---|---|---|
account | ObjectId | yes | accountId |
team | ObjectId | yes | teamId |
fields.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader. |
value | any | no |
location (object):
| Field | Type | Required | Description |
|---|---|---|---|
type | point | area | polyline | no | |
label | string | no | |
data | object[] | no | See below. |
location.data[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | no | |
lng | number | no |
links[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | |
linkId | ObjectId | no | |
type | reaction | tag | linked-to | in_process | user-mention | apple-id | feed.lastseen | no | |
created | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
ballHolder (object):
| Field | Type | Required | Description |
|---|---|---|---|
userId | ObjectId | yes | |
assignedAt | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
assignedBy | ObjectId | yes |
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.
activities.phase_count
Description
If given a valid workflowId which the user has permission to view, will give out a count of the amount of activities are currently in each phase of the workflow.
If possible, please use the function v3/activities/list instead.
Parameters
Argument 1 (processId, optional): workflowId
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('activities.phase_count', [
'507f1f77bcf86cd799439011', // processId
]);
console.log(result);Returns
Undocumented
The return value is not described in the source yet.
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.
activities.remove
Description
When provided a valid activityId or an array of activityIds, this function will remove the provided activities.
If the user does not have the required permissions or is a Guest User in the network the activities are in, it will return the appropriate error message
Parameters
Argument 1 (ObjectId \| ObjectId[], 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('activities.remove', [
'507f1f77bcf86cd799439011', // argument 1 (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
success | activityId[] | yes | |
failed | activityId[] | yes |
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.
activities.search
Description
Searches for an activity whose name contains the substring provided, in a the designated process.
Example: In a process X with the activities foo, foob, fooba & foobar calling this function with the request {0:'fooba', 1:'X'} should return [fooba, foobar].
Parameters
Argument 1 (string, required): Substring to search activity names with
Argument 2 (processId[], required): Id for the process to search in
Argument 3 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
fieldFilters | object[] | no | See below. |
matchAllFieldFilters | boolean | no |
fieldFilters[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
targetWorkflowId | processId | yes | workflowId |
targetFieldId | fieldId | yes | fieldId |
sourceFieldValue | any | 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('activities.search', [
'string', // Substring to search activity names with (required)
['507f1f77bcf86cd799439011'],
{
fieldFilters: [{
targetWorkflowId: '507f1f77bcf86cd799439011', // workflowId
targetFieldId: '507f1f77bcf86cd799439011', // fieldId
}],
matchAllFieldFilters: false,
},
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
_id | activityId | yes | activityId |
name | string | no | |
active | boolean | no | |
process | processId | yes | workflowId |
currentPhase | phaseId | yes | phaseId (phase in a Workflow) |
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.
activities.set_update
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
activities | ObjectId[] | yes | |
completedOn | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
created | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
openAndMoveToPhase | ObjectId | no | |
owner | ObjectId | no | |
team_account | object | no | See below. |
team_account (object):
| Field | Type | Required | Description |
|---|---|---|---|
account | ObjectId | yes | accountId |
team | ObjectId | yes | teamId |
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('activities.set_update', [
{
activities: ['507f1f77bcf86cd799439011'],
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
phase_id | phaseId | yes | phaseId (phase in a Workflow) |
activities | activityId[] | yes |
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.
activities.update
Description
Note: We highly recommend you use the v3.activity.updateMany endpointWhen called with a correctly formatted Activity object, it will update the indicated Activity. The request will return an error if the user lacks permissions to edit the Activity in question.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
activities | Record<string, object> | no | See below. |
completeAction | object | no | See below. |
activities.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
fields | any | no | |
files | ObjectId[] | no | |
location | object | no | See below. |
name | string | no |
activities.*.location (object):
| Field | Type | Required | Description |
|---|---|---|---|
label | string | no | |
type | area | point | polyline | yes | |
data | object[] | no | See below. |
activities.*.location.data[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | yes | Latitude |
lng | number | yes | Longitude |
completeAction (object):
| Field | Type | Required | Description |
|---|---|---|---|
nextPhase | 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('activities.update', [
{
activities: {
'507f1f77bcf86cd799439012': { /* ... */ }, // fieldId: value
},
completeAction: {
nextPhase: '507f1f77bcf86cd799439011',
},
},
]);
console.log(result);Returns
object
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.