Appearance
Activity list
List and query activities.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v3.activity.events | startDate: number, endDate: number, options?: { workspaceId?: string, processId?: string } | object[] |
v3.activity.list | query: { processId: string, phaseId: string, limit?: number, skip?: number, search?: string, workspaceId?: string } | object |
v3.activity.timeline | startDate: number, endDate: number, options?: { workspaceId?: string, processId?: string, phaseId?: string, groupByField?: string } | object |
v3.activity.events
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (JoiTime, timestamp, required): Start Date as iso date string or timestamp
Argument 2 (JoiTime, timestamp, required): End Date as iso date string or timestamp
Argument 3 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
filter | object | no | See below. |
fieldIds | fieldId[] | no | |
workflowIds | processId[] | no | |
workspaceIds | WorkspaceId[] | no | |
activityIds | activityId[] | no | |
unassigned | boolean | no | Load events with no assigned people |
filter (object):
| Field | Type | Required | Description |
|---|---|---|---|
and | object[] | no | See below. |
or | object[] | no | See below. |
filter.and[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no |
filter.or[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | 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('v3.activity.events', [
Date.now(), // JoiTime (required)
Date.now(), // JoiTime (required)
{
filter: {
and: [{ /* ... */ }],
or: [{ /* ... */ }],
},
fieldIds: ['507f1f77bcf86cd799439011'],
},
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Event id based on activity id and field id |
title | string | yes | Activity name |
extendedProps | object | yes | Activity meta data See below. |
start | timestamp | yes | Start timestamp |
end | timestamp | any | yes | End timestamp. Will be false on single all day event. |
allDay | boolean | yes | All day event |
extendedProps (object):
| Field | Type | Required | Description |
|---|---|---|---|
workspace_id | ObjectId | yes | Workspace id |
activity_id | ObjectId | yes | Activity id |
created | timestamp | yes | Activity creation date |
updated | timestamp | yes | Activity modification date |
completed | timestamp | no | Activity completion date |
phase | object | yes | Phase Meta See below. |
process | object | yes | Process Meta See below. |
field | object | yes | Field Meta See below. |
ballHolder | object | no | Ball holder See below. |
discussionId | ObjectId | no | Discussion id |
extendedProps.phase (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Phase id |
name | string | yes | Phase name |
isEndpoint | boolean | no | Is Phase endpoint |
extendedProps.process (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Process id |
name | string | yes | Process name |
extendedProps.field (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | Field id |
label | string | yes | Field label |
type | date | daterange | datetime | datetimerange | yes | Field type |
extendedProps.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.
v3.activity.list
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (Workflow object, required):
| Field | Type | Required | Description |
|---|---|---|---|
processId | processId | string | yes | |
phaseId | phaseId | string | yes |
Argument 2 (Options object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
sortBy | name | created | updated | following | owner | team | completedOn | priority | ObjectId | no | Default: "updated". |
sortOrder | asc | desc | no | "asc" for ascending and "desc" for descending order Default: "desc". |
limit | integer | no | Limit the maximum number of results Default: 20. |
page | integer | no | Current page. Default: 1 Default: 0. |
skip | integer | no | Old: Skip the number of first results. Default: 0 Default: 0. |
includeUsers | boolean | no | Includes available users & fields list in the "metadata" object Default: true. |
includeTeams | boolean | no | Includes available teams & accounts list in the "metadata" object Default: true. |
includeDates | boolean | no | Includes primary date range in the "metadata" object Default: false. |
includeStats | boolean | no | Includes stats in the "metadata" object Default: false. |
includeActivityLinks | boolean | no | Includes activity link counts for activities Default: true. |
includeHistory | boolean | no | Includes "history" array of objects with all versions of the activity Default: false. |
filters | any | no | |
filter | any | no | |
search | string | any | no | |
returnFlat | boolean | no | Default: false. |
readPreference | primary | primaryPreferred | secondary | secondaryPreferred | no | Specify an optional readPreference for the query |
useIndexedData | boolean | no | Can prevent the use of IndexedData even if it available in the workspace. Default: true. |
workspaceId | WorkspaceId | no | workspaceId (former networkId) |
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('v3.activity.list', [
{
processId: '507f1f77bcf86cd799439011',
phaseId: '507f1f77bcf86cd799439011',
},
{
sortBy: 'name',
sortOrder: 'asc', // "asc" for ascending and "desc" for descending order
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activities | object[] | no | See below. |
metadata | object | no | See below. |
activities[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | The _id of the activity |
process | processId | yes | workflowId |
followers | ObjectId[] | no | |
team_account | object | yes | See below. |
name | string | no | The name of the activity |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
uid | userId | yes | userId |
currentPhase | phaseId | yes | phaseId (phase in a Workflow) |
discussion | discussionId | yes | discussionId |
fields | Record<string, any> | no | Fields of activity, format of items is dependent on the configuration of the process given in process field, and options in request. |
history | object[] | no | All versions of the activity |
files | ObjectId[] | no | |
priority | number | no | |
active | boolean | no | Activity not in endpoint phase is considered active |
location | object | no | See below. |
sequence | number | no | |
ballHolder | object | no | See below. |
activities[].team_account (object):
| Field | Type | Required | Description |
|---|---|---|---|
account | ObjectId | yes | accountId |
team | ObjectId | yes | teamId |
activities[].location (object):
| Field | Type | Required | Description |
|---|---|---|---|
type | point | area | polyline | no | |
label | string | no | |
data | object[] | no | See below. |
activities[].location.data[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | no | |
lng | number | no |
activities[].ballHolder (object):
| Field | Type | Required | Description |
|---|---|---|---|
userId | ObjectId | yes | |
assignedAt | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
assignedBy | ObjectId | yes |
metadata (object):
| Field | Type | Required | Description |
|---|---|---|---|
activityLinks | Record<string, number> | no | [activity string]: number |
totalCount | number | yes | Total number of results. |
users | Record<string, ObjectId[]> | no | [fieldId string]: userId[] |
teams | Record<string, ObjectId[]> | no | [teamId: string]: accountId[] |
dates | object | no | See below. |
totalPrimaryNumericValue | number | no | |
behindSchedule | number | no | |
lessThanOneWeek | number | no | |
onSchedule | number | no | |
behindScheduleValue | number | no | |
lessThanOneWeekValue | number | no | |
onScheduleValue | number | no | |
primaryNumericFieldUnit | string | no |
metadata.dates (object):
| Field | Type | Required | Description |
|---|---|---|---|
start | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
end | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
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.
v3.activity.timeline
Description
Returns activity events for full-calendar timeline from specified time period and grouped by a field. Allows sending activity filtering
Parameters
Argument 1 (JoiTime, timestamp, required): Start Date as iso date string or timestamp
Argument 2 (JoiTime, timestamp, required): End Date as iso date string or timestamp
Argument 3 (Options, required):
| Field | Type | Required | Description |
|---|---|---|---|
filter | object | no | See below. |
groupBy | Record<string, fieldId | name | team_account> | yes | { WorkflowId: FieldId } to group by |
resourceIds | fieldId[] | no | Show only these resources |
showEmptyResources | boolean | no | Whether to return resources with no events or not |
fieldIds | fieldId[] | no | Which date fields to return events with |
activityIds | activityId[] | no |
filter (object):
| Field | Type | Required | Description |
|---|---|---|---|
and | object[] | no | See below. |
or | object[] | no | See below. |
filter.and[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no |
filter.or[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | 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('v3.activity.timeline', [
Date.now(), // JoiTime (required)
Date.now(), // JoiTime (required)
{
groupBy: {
'507f1f77bcf86cd799439012': '507f1f77bcf86cd799439011', // fieldId: value
}, // { WorkflowId: FieldId } to group by
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activities | object[] | no | See below. |
resources | object[] | no | See below. |
activities[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
title | string | yes | |
start | number | yes | |
end | number | yes | |
resourceId | string | yes | |
allDay | boolean | yes | |
extendedProps | object | no | See below. |
activities[].extendedProps (object):
| Field | Type | Required | Description |
|---|---|---|---|
activityId | activityId | yes | activityId |
workflowId | processId | yes | workflowId |
workflowName | string | yes | |
phaseId | phaseId | yes | phaseId (phase in a Workflow) |
phaseName | string | yes | |
groupBy | object | yes | See below. |
fieldId | fieldId | yes | fieldId |
fieldName | string | yes | |
ballHolder | object | no | Ball holder See below. |
discussionId | ObjectId | no | Discussion id |
activities[].extendedProps.groupBy (object):
| Field | Type | Required | Description |
|---|---|---|---|
id | fieldId | no | fieldId |
type | string | yes | One of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader, noFieldSet. |
value | any | no |
activities[].extendedProps.ballHolder (object):
| Field | Type | Required | Description |
|---|---|---|---|
userId | ObjectId | yes | |
assignedAt | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
assignedBy | ObjectId | yes |
resources[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
groupBy | string | yes | |
id | string | yes | |
title | string | yes | |
sorter | string | 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.