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?, debug? }.
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?, debug? }.
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?, debug? }.
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?, debug? }.
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?, debug? }.
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 | |
priority | number | no | |
processFields | Record<string, object> | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
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 | |
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. |
files | any[] | no | |
location | object | no | |
priority | number | no | |
active | boolean | no | Activity not in endpoint phase is considered active |
links | object[] | no | |
sequence | number | no | |
ballHolder | object | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
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?, debug? }.
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?, debug? }.
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 | |
matchAllFieldFilters | 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('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?, debug? }.
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 |
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?, debug? }.
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 | |
completeAction | object | 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?, debug? }.