Skip to content

Activity list ​

List and query activities.

Endpoints ​

EndpointArgumentsReturns
v3.activity.eventsstartDate: number, endDate: number, options?: { workspaceId?: string, processId?: string }object[]
v3.activity.listquery: { processId: string, phaseId: string, limit?: number, skip?: number, search?: string, workspaceId?: string }object
v3.activity.timelinestartDate: 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):

FieldTypeRequiredDescription
filterobjectnoSee below.
fieldIdsfieldId[]no
workflowIdsprocessId[]no
workspaceIdsWorkspaceId[]no
activityIdsactivityId[]no
unassignedbooleannoLoad events with no assigned people

filter (object):

FieldTypeRequiredDescription
andobject[]noSee below.
orobject[]noSee below.

filter.and[] (object):

FieldTypeRequiredDescription
namestringno

filter.or[] (object):

FieldTypeRequiredDescription
namestringno

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:

FieldTypeRequiredDescription
idstringyesEvent id based on activity id and field id
titlestringyesActivity name
extendedPropsobjectyesActivity meta data See below.
starttimestampyesStart timestamp
endtimestamp | anyyesEnd timestamp. Will be false on single all day event.
allDaybooleanyesAll day event

extendedProps (object):

FieldTypeRequiredDescription
workspace_idObjectIdyesWorkspace id
activity_idObjectIdyesActivity id
createdtimestampyesActivity creation date
updatedtimestampyesActivity modification date
completedtimestampnoActivity completion date
phaseobjectyesPhase Meta See below.
processobjectyesProcess Meta See below.
fieldobjectyesField Meta See below.
ballHolderobjectnoBall holder See below.
discussionIdObjectIdnoDiscussion id

extendedProps.phase (object):

FieldTypeRequiredDescription
_idObjectIdyesPhase id
namestringyesPhase name
isEndpointbooleannoIs Phase endpoint

extendedProps.process (object):

FieldTypeRequiredDescription
_idObjectIdyesProcess id
namestringyesProcess name

extendedProps.field (object):

FieldTypeRequiredDescription
_idObjectIdyesField id
labelstringyesField label
typedate | daterange | datetime | datetimerangeyesField type

extendedProps.ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

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

FieldTypeRequiredDescription
processIdprocessId | stringyes
phaseIdphaseId | stringyes

Argument 2 (Options object, optional):

FieldTypeRequiredDescription
sortByname | created | updated | following | owner | team | completedOn | priority | ObjectIdnoDefault: "updated".
sortOrderasc | descno"asc" for ascending and "desc" for descending order Default: "desc".
limitintegernoLimit the maximum number of results Default: 20.
pageintegernoCurrent page. Default: 1 Default: 0.
skipintegernoOld: Skip the number of first results. Default: 0 Default: 0.
includeUsersbooleannoIncludes available users & fields list in the "metadata" object Default: true.
includeTeamsbooleannoIncludes available teams & accounts list in the "metadata" object Default: true.
includeDatesbooleannoIncludes primary date range in the "metadata" object Default: false.
includeStatsbooleannoIncludes stats in the "metadata" object Default: false.
includeActivityLinksbooleannoIncludes activity link counts for activities Default: true.
includeHistorybooleannoIncludes "history" array of objects with all versions of the activity Default: false.
filtersanyno
filteranyno
searchstring | anyno
returnFlatbooleannoDefault: false.
readPreferenceprimary | primaryPreferred | secondary | secondaryPreferrednoSpecify an optional readPreference for the query
useIndexedDatabooleannoCan prevent the use of IndexedData even if it available in the workspace. Default: true.
workspaceIdWorkspaceIdnoworkspaceId (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

FieldTypeRequiredDescription
activitiesobject[]noSee below.
metadataobjectnoSee below.

activities[] (object):

FieldTypeRequiredDescription
_idObjectIdyesThe _id of the activity
processprocessIdyesworkflowId
followersObjectId[]no
team_accountobjectyesSee below.
namestringnoThe name of the activity
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
uiduserIdyesuserId
currentPhasephaseIdyesphaseId (phase in a Workflow)
discussiondiscussionIdyesdiscussionId
fieldsRecord<string, any>noFields of activity, format of items is dependent on the configuration of the process given in process field, and options in request.
historyobject[]noAll versions of the activity
filesObjectId[]no
prioritynumberno
activebooleannoActivity not in endpoint phase is considered active
locationobjectnoSee below.
sequencenumberno
ballHolderobjectnoSee below.

activities[].team_account (object):

FieldTypeRequiredDescription
accountObjectIdyesaccountId
teamObjectIdyesteamId

activities[].location (object):

FieldTypeRequiredDescription
typepoint | area | polylineno
labelstringno
dataobject[]noSee below.

activities[].location.data[] (object):

FieldTypeRequiredDescription
latnumberno
lngnumberno

activities[].ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

metadata (object):

FieldTypeRequiredDescription
activityLinksRecord<string, number>no[activity string]: number
totalCountnumberyesTotal number of results.
usersRecord<string, ObjectId[]>no[fieldId string]: userId[]
teamsRecord<string, ObjectId[]>no[teamId: string]: accountId[]
datesobjectnoSee below.
totalPrimaryNumericValuenumberno
behindSchedulenumberno
lessThanOneWeeknumberno
onSchedulenumberno
behindScheduleValuenumberno
lessThanOneWeekValuenumberno
onScheduleValuenumberno
primaryNumericFieldUnitstringno

metadata.dates (object):

FieldTypeRequiredDescription
starttimestampnoTime (milliseconds since 1970-01-01 UTC)
endtimestampnoTime (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):

FieldTypeRequiredDescription
filterobjectnoSee below.
groupByRecord<string, fieldId | name | team_account>yes{ WorkflowId: FieldId } to group by
resourceIdsfieldId[]noShow only these resources
showEmptyResourcesbooleannoWhether to return resources with no events or not
fieldIdsfieldId[]noWhich date fields to return events with
activityIdsactivityId[]no

filter (object):

FieldTypeRequiredDescription
andobject[]noSee below.
orobject[]noSee below.

filter.and[] (object):

FieldTypeRequiredDescription
namestringno

filter.or[] (object):

FieldTypeRequiredDescription
namestringno

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

FieldTypeRequiredDescription
activitiesobject[]noSee below.
resourcesobject[]noSee below.

activities[] (object):

FieldTypeRequiredDescription
idstringyes
titlestringyes
startnumberyes
endnumberyes
resourceIdstringyes
allDaybooleanyes
extendedPropsobjectnoSee below.

activities[].extendedProps (object):

FieldTypeRequiredDescription
activityIdactivityIdyesactivityId
workflowIdprocessIdyesworkflowId
workflowNamestringyes
phaseIdphaseIdyesphaseId (phase in a Workflow)
phaseNamestringyes
groupByobjectyesSee below.
fieldIdfieldIdyesfieldId
fieldNamestringyes
ballHolderobjectnoBall holder See below.
discussionIdObjectIdnoDiscussion id

activities[].extendedProps.groupBy (object):

FieldTypeRequiredDescription
idfieldIdnofieldId
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader, noFieldSet.
valueanyno

activities[].extendedProps.ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

resources[] (object):

FieldTypeRequiredDescription
groupBystringyes
idstringyes
titlestringyes
sorterstringno

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.

Hailer Developer Documentation · v1.8.0