Skip to content

Feed

Feed (wall) posts and comments.

Endpoints

EndpointArgumentsReturns
v3.feed.post.create`workspaceId: stringstring[], postData: any, options?: any`
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.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
linksarrayno

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: [],
  },
]);
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.updatedyesOne of: user, activity.created, activity.updated.
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[]no
linkedDataarrayno
deleteAtDatenoDate after which the feed post should be automatically deleted (BSON Date driven by sender's messageTTL)
commentsobject[]no
_metasobjectno
isStarredbooleanno

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

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?, debug? }.

v3.feed.post.load

Description

Loads feed posts from given workspaces or specifics posts

Parameters

Argument 1 (object, optional):

FieldTypeRequiredDescription
typeuser | 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
sortobjectno
searchstringnoTEMPORARY search string

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[]yes
detailsobjectno

Auth: requires an authenticated session.

Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.

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?, debug? }.

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?, debug? }.

Hailer Developer Documentation