Appearance
Feed
Feed (wall) posts and comments.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v3.feed.post.create | workspaceId: string | string[], postData: any, options?: any | object |
v3.feed.post.edit | postsToEdit: { [postId: string]: any } | object |
v3.feed.post.load | query: { type?: string[], postIds?: string[], workspaceIds?: string[], limit?: number, skip?: number, startTime?: number, endTime?: number } | object |
v3.feed.post.tags | options?: { workspaceIds?: string[] } | array |
v3.feed.post.toggle.star | postId: string | boolean |
v3.feed.recipients.count | workspaceIds: 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):
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | yes | |
text | string | yes | |
files | ObjectId[] | no | |
allowReply | boolean | no | |
draft | boolean | no | |
scheduled | boolean | no | |
scheduleTime | number | no | |
recipients | string[] | no | User / Team / Network / Group |
Argument 3 (Options for feed post, optional):
| Field | Type | Required | Description |
|---|---|---|---|
links | object[] | no | See below. |
links[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
target | ObjectId | no | |
type | reaction | tag | linked-to | in_process | user-mention | apple-id | feed.lastseen | no | |
targetType | string | no | |
sourceType | feedPost | message | 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.feed.post.create', [
'507f1f77bcf86cd799439011', // argument 1 (required)
{
subject: 'string',
text: 'string',
},
{
links: [{
target: '507f1f77bcf86cd799439011',
type: 'reaction',
}],
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
cid | ObjectId | yes | |
cids | ObjectId[] | no | |
uid | ObjectId | yes | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
edited | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
updatedBy | ObjectId | no | |
type | user | activity.created | activity.updated | yes | |
followers | ObjectId[] | no | |
likes | ObjectId[] | no | |
last_active | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
linked_activity | ObjectId | no | |
linked_discussion | ObjectId | no | |
allowReply | boolean | no | |
draft | boolean | no | |
scheduled | boolean | no | |
scheduleTime | number | no | |
initMessage | object | no | |
recipients | string[] | no | User / Team / Network / Group |
pinned | boolean | no | |
stars | object[] | no | See below. |
linkedData | array | no | |
deleteAt | Date | no | Date after which the feed post should be automatically deleted (BSON Date driven by sender's messageTTL) |
comments | object[] | no | See below. |
_metas | object | no | See below. |
isStarred | boolean | no |
stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
uid | userId | no | userId |
created | number | no |
comments[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
cid | ObjectId | yes | |
uid | ObjectId | yes | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
post_id | ObjectId | yes | |
deleteAt | Date | no | Date after which the comment should be automatically deleted (BSON Date driven by the commenter's messageTTL) |
comment | object | no | See below. |
_metas | object | no | See below. |
comments[].comment (object):
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | |
loc | object | no | See below. |
files | ObjectId[] | no |
comments[].comment.loc (object):
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | no | |
lng | number | no | |
name | string | no | |
time | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
comments[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<fileId, object> | no | See below. |
comments[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
_metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<fileId, object> | no | See below. |
recipients | Record<string, object> | no | Names and membership of the post's team, group and network recipients See below. |
_metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no | See below. |
_metas.files.*.dimensions (object):
| Field | Type | Required | Description |
|---|---|---|---|
height | number | no | |
width | number | no | |
aspectRatio | number | no |
_metas.recipients.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
type | team | group | network | yes | |
name | string | yes | |
workspaceId | WorkspaceId | yes | The post workspace the recipient belongs to |
memberCount | number | no | Number of direct members |
members | string[] | no | Only present for recipients the client belongs to |
groups | ObjectId[] | no | Nested 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):
| Field | Type | Required | Description |
|---|---|---|---|
type | (user | activity.created | activity.updated)[] | no | Filter by feed post type |
postIds | ObjectId[] | no | |
workspaceIds | WorkspaceId[] | no | Load posts from specific workspaces. Defaults to loading from all user workspaces |
limit | number | no | Limit the number of posts to load Default: 20. |
skip | number | no | Skip number of posts. Useful for pagination |
onlyStarred | boolean | no | Load only feed posts client has starred |
onlyDrafts | boolean | no | Load user drafts |
onlyScheduled | boolean | no | Load user scheduled posts |
includeDrafts | boolean | no | Include user drafts |
includeScheduled | boolean | no | Include user scheduled posts |
includeHidden | boolean | no | Include hidden posts |
includeTags | boolean | no | Include feed tags |
sort | object | no | See below. |
search | string | no | TEMPORARY search string |
sort (object):
| Field | Type | Required | Description |
|---|---|---|---|
created | number | no | |
relevance | number | no | Sort 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
| Field | Type | Required | Description |
|---|---|---|---|
posts | object[] | yes | See below. |
details | object | no | See below. |
posts[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
cid | ObjectId | yes | |
cids | ObjectId[] | no | |
uid | ObjectId | yes | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
edited | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
updatedBy | ObjectId | no | |
type | user | activity.created | activity.updated | yes | |
followers | ObjectId[] | no | |
likes | ObjectId[] | no | |
last_active | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
linked_activity | ObjectId | no | |
linked_discussion | ObjectId | no | |
allowReply | boolean | no | |
draft | boolean | no | |
scheduled | boolean | no | |
scheduleTime | number | no | |
initMessage | object | no | |
recipients | string[] | no | User / Team / Network / Group |
pinned | boolean | no | |
stars | object[] | no | See below. |
linkedData | array | no | |
deleteAt | Date | no | Date after which the feed post should be automatically deleted (BSON Date driven by sender's messageTTL) |
comments | object[] | no | See below. |
_metas | object | no | See below. |
isStarred | boolean | no |
posts[].stars[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
uid | userId | no | userId |
created | number | no |
posts[].comments[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
cid | ObjectId | yes | |
uid | ObjectId | yes | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
post_id | ObjectId | yes | |
deleteAt | Date | no | Date after which the comment should be automatically deleted (BSON Date driven by the commenter's messageTTL) |
comment | object | no | See below. |
_metas | object | no | See below. |
posts[].comments[].comment (object):
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | |
loc | object | no | |
files | ObjectId[] | no |
posts[].comments[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<fileId, object> | no |
posts[]._metas (object):
| Field | Type | Required | Description |
|---|---|---|---|
files | Record<fileId, object> | no | See below. |
recipients | Record<string, object> | no | Names and membership of the post's team, group and network recipients See below. |
posts[]._metas.files.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | no | |
hash | binary | no | |
uid | ObjectId | yes | |
length | number | no | |
name | string | no | |
created | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
updated | timestamp | no | Time (milliseconds since 1970-01-01 UTC) |
removed | timestamp | no | Soft-delete timestamp; set when a DigiOne user deletes the file |
type | string | yes | MIME file type |
isPicture | boolean | no | |
isVideo | boolean | no | |
isPublic | boolean | no | |
fileSets | ObjectId[] | no | |
tags | string[] | no | |
cid | WorkspaceId | no | Workspace scope. Absent for legacy (unscoped) files; immutable once set |
readers | string[] | no | ACL of a workspace-scoped file |
dimensions | object | no |
posts[]._metas.recipients.* (object):
| Field | Type | Required | Description |
|---|---|---|---|
type | team | group | network | yes | |
name | string | yes | |
workspaceId | WorkspaceId | yes | The post workspace the recipient belongs to |
memberCount | number | no | Number of direct members |
members | string[] | no | Only present for recipients the client belongs to |
groups | ObjectId[] | no | Nested groups, only present for groups the client belongs to |
details (object):
| Field | Type | Required | Description |
|---|---|---|---|
scheduledPosts | object[] | no | See below. |
draftPosts | object[] | no | See below. |
hiddenPosts | ObjectId[] | no | |
lastSeen | Record<userId, timestamp> | no | |
tags | object[] | no | See below. |
details.scheduledPosts[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | feedPostId |
scheduleTime | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
details.draftPosts[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | feedPostId |
draft | boolean | yes |
details.tags[] (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | yes | |
target | string | yes | |
source | string | no | |
activity | object | no | See below. |
weight | number | no | |
mostRecent | number | no |
details.tags[].activity (object):
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | yes | |
name | string | 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.feed.post.tags
Description
Get tags
Parameters
Argument 1 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
workspaceIds | WorkspaceId[] | no | Load 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
| Field | Type | Required | Description |
|---|---|---|---|
total | integer | yes | Distinct 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.