Skip to content

Feed ​

Feed (wall) posts and comments.

Endpoints ​

EndpointArgumentsReturns
v3.feed.post.createworkspaceId: string | string[], postData: any, options?: anyobject
v3.feed.post.editpostsToEdit: { [postId: string]: any }object
v3.feed.post.loadquery: { type?: string[], postIds?: string[], workspaceIds?: string[], limit?: number, skip?: number, startTime?: number, endTime?: number }object
v3.feed.post.tagsoptions?: { workspaceIds?: string[] }array
v3.feed.post.toggle.starpostId: stringboolean
v3.feed.recipients.countworkspaceIds: string[], recipients: string[]object

v3.feed.post.create ​

Description

Create wallpost to one or more networks. Multiple networks create one shared post with replies disabled (DigiOne only)

Parameters

Argument 1 (WorkspaceId \| WorkspaceId[], required):

Argument 2 (object, optional):

FieldTypeRequiredDescription
subjectstringyes
textstringyes
filesObjectId[]no
allowReplybooleanno
draftbooleanno
scheduledbooleanno
scheduleTimenumberno
recipientsstring[]noUser / Team / Network / Group

Argument 3 (Options for feed post, optional):

FieldTypeRequiredDescription
linksobject[]noSee below.

links[] (object):

FieldTypeRequiredDescription
targetObjectIdno
typereaction | tag | linked-to | in_process | user-mention | apple-id | feed.lastseenno
targetTypestringno
sourceTypefeedPost | messageno

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.feed.post.create', [
  '507f1f77bcf86cd799439011', // argument 1 (required)
  {
    subject: 'string',
    text: 'string',
  },
  {
    links: [{
      target: '507f1f77bcf86cd799439011',
      type: 'reaction',
    }],
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
cidObjectIdyes
cidsObjectId[]no
uidObjectIdyes
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
editedtimestampnoTime (milliseconds since 1970-01-01 UTC)
updatedByObjectIdno
typeuser | activity.created | activity.updatedyes
followersObjectId[]no
likesObjectId[]no
last_activetimestampnoTime (milliseconds since 1970-01-01 UTC)
linked_activityObjectIdno
linked_discussionObjectIdno
allowReplybooleanno
draftbooleanno
scheduledbooleanno
scheduleTimenumberno
initMessageobjectno
recipientsstring[]noUser / Team / Network / Group
pinnedbooleanno
starsobject[]noSee below.
linkedDataarrayno
deleteAtDatenoDate after which the feed post should be automatically deleted (BSON Date driven by sender's messageTTL)
commentsobject[]noSee below.
_metasobjectnoSee below.
isStarredbooleanno

stars[] (object):

FieldTypeRequiredDescription
uiduserIdnouserId
creatednumberno

comments[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
cidObjectIdyes
uidObjectIdyes
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
post_idObjectIdyes
deleteAtDatenoDate after which the comment should be automatically deleted (BSON Date driven by the commenter's messageTTL)
commentobjectnoSee below.
_metasobjectnoSee below.

comments[].comment (object):

FieldTypeRequiredDescription
textstringno
locobjectnoSee below.
filesObjectId[]no

comments[].comment.loc (object):

FieldTypeRequiredDescription
latnumberno
lngnumberno
namestringno
timetimestampnoTime (milliseconds since 1970-01-01 UTC)

comments[]._metas (object):

FieldTypeRequiredDescription
filesRecord<fileId, object>noSee below.

comments[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

_metas (object):

FieldTypeRequiredDescription
filesRecord<fileId, object>noSee below.
recipientsRecord<string, object>noNames and membership of the post's team, group and network recipients See below.

_metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectnoSee below.

_metas.files.*.dimensions (object):

FieldTypeRequiredDescription
heightnumberno
widthnumberno
aspectRationumberno

_metas.recipients.* (object):

FieldTypeRequiredDescription
typeteam | group | networkyes
namestringyes
workspaceIdWorkspaceIdyesThe post workspace the recipient belongs to
memberCountnumbernoNumber of direct members
membersstring[]noOnly present for recipients the client belongs to
groupsObjectId[]noNested groups, only present for groups the client belongs to

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.feed.post.edit ​

Description

Edits given feed post

Parameters

Argument 1 (Record<ObjectId, object>, 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('v3.feed.post.edit', [
  {
    '507f1f77bcf86cd799439012': {
      subject: 'string',
      text: 'string',
    }, // fieldId: value
  },
]);
console.log(result);

Returns

Record<ObjectId, 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.

v3.feed.post.load ​

Description

Loads feed posts from given workspaces or specifics posts

Parameters

Argument 1 (object, optional):

FieldTypeRequiredDescription
type(user | activity.created | activity.updated)[]noFilter by feed post type
postIdsObjectId[]no
workspaceIdsWorkspaceId[]noLoad posts from specific workspaces. Defaults to loading from all user workspaces
limitnumbernoLimit the number of posts to load Default: 20.
skipnumbernoSkip number of posts. Useful for pagination
onlyStarredbooleannoLoad only feed posts client has starred
onlyDraftsbooleannoLoad user drafts
onlyScheduledbooleannoLoad user scheduled posts
includeDraftsbooleannoInclude user drafts
includeScheduledbooleannoInclude user scheduled posts
includeHiddenbooleannoInclude hidden posts
includeTagsbooleannoInclude feed tags
sortobjectnoSee below.
searchstringnoTEMPORARY search string

sort (object):

FieldTypeRequiredDescription
creatednumberno
relevancenumbernoSort by text relevance score. Ignored when search is not set

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.feed.post.load', [
  {
    type: ['user'], // Filter by feed post type
    postIds: ['507f1f77bcf86cd799439011'],
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
postsobject[]yesSee below.
detailsobjectnoSee below.

posts[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
cidObjectIdyes
cidsObjectId[]no
uidObjectIdyes
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
editedtimestampnoTime (milliseconds since 1970-01-01 UTC)
updatedByObjectIdno
typeuser | activity.created | activity.updatedyes
followersObjectId[]no
likesObjectId[]no
last_activetimestampnoTime (milliseconds since 1970-01-01 UTC)
linked_activityObjectIdno
linked_discussionObjectIdno
allowReplybooleanno
draftbooleanno
scheduledbooleanno
scheduleTimenumberno
initMessageobjectno
recipientsstring[]noUser / Team / Network / Group
pinnedbooleanno
starsobject[]noSee below.
linkedDataarrayno
deleteAtDatenoDate after which the feed post should be automatically deleted (BSON Date driven by sender's messageTTL)
commentsobject[]noSee below.
_metasobjectnoSee below.
isStarredbooleanno

posts[].stars[] (object):

FieldTypeRequiredDescription
uiduserIdnouserId
creatednumberno

posts[].comments[] (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
cidObjectIdyes
uidObjectIdyes
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
post_idObjectIdyes
deleteAtDatenoDate after which the comment should be automatically deleted (BSON Date driven by the commenter's messageTTL)
commentobjectnoSee below.
_metasobjectnoSee below.

posts[].comments[].comment (object):

FieldTypeRequiredDescription
textstringno
locobjectno
filesObjectId[]no

posts[].comments[]._metas (object):

FieldTypeRequiredDescription
filesRecord<fileId, object>no

posts[]._metas (object):

FieldTypeRequiredDescription
filesRecord<fileId, object>noSee below.
recipientsRecord<string, object>noNames and membership of the post's team, group and network recipients See below.

posts[]._metas.files.* (object):

FieldTypeRequiredDescription
_idObjectIdno
hashbinaryno
uidObjectIdyes
lengthnumberno
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
removedtimestampnoSoft-delete timestamp; set when a DigiOne user deletes the file
typestringyesMIME file type
isPicturebooleanno
isVideobooleanno
isPublicbooleanno
fileSetsObjectId[]no
tagsstring[]no
cidWorkspaceIdnoWorkspace scope. Absent for legacy (unscoped) files; immutable once set
readersstring[]noACL of a workspace-scoped file
dimensionsobjectno

posts[]._metas.recipients.* (object):

FieldTypeRequiredDescription
typeteam | group | networkyes
namestringyes
workspaceIdWorkspaceIdyesThe post workspace the recipient belongs to
memberCountnumbernoNumber of direct members
membersstring[]noOnly present for recipients the client belongs to
groupsObjectId[]noNested groups, only present for groups the client belongs to

details (object):

FieldTypeRequiredDescription
scheduledPostsobject[]noSee below.
draftPostsobject[]noSee below.
hiddenPostsObjectId[]no
lastSeenRecord<userId, timestamp>no
tagsobject[]noSee below.

details.scheduledPosts[] (object):

FieldTypeRequiredDescription
_idObjectIdyesfeedPostId
scheduleTimetimestampyesTime (milliseconds since 1970-01-01 UTC)

details.draftPosts[] (object):

FieldTypeRequiredDescription
_idObjectIdyesfeedPostId
draftbooleanyes

details.tags[] (object):

FieldTypeRequiredDescription
_idstringyes
targetstringyes
sourcestringno
activityobjectnoSee below.
weightnumberno
mostRecentnumberno

details.tags[].activity (object):

FieldTypeRequiredDescription
_idstringyes
namestringyes

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.feed.post.tags ​

Description

Get tags

Parameters

Argument 1 (object, optional):

FieldTypeRequiredDescription
workspaceIdsWorkspaceId[]noLoad tags from specific workspaces. Defaults to loading from all user workspaces

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.feed.post.tags', [
  {
    workspaceIds: ['507f1f77bcf86cd799439011'], // Load tags from specific workspaces. Defaults to loading from all user workspaces
  },
]);
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.

v3.feed.post.toggle.star ​

Description

Star/unstar a post

Parameters

Argument 1 (ObjectId, required): feedPostId

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.feed.post.toggle.star', [
  '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.

v3.feed.recipients.count ​

Description

Counts the distinct people a feed post to the given workspaces and recipients would reach, excluding the caller. Without recipients, counts every non-guest member of the workspaces. Recipients must be ones the caller can pick

Parameters

Argument 1 (WorkspaceId[], required):

Argument 2 (string[], required): User / Team / Network / Group

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.feed.recipients.count', [
  ['507f1f77bcf86cd799439011'],
  ['string'],
]);
console.log(result);

Returns

FieldTypeRequiredDescription
totalintegeryesDistinct people across all recipients

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