Appearance
Feed
Feed (wall) posts and comments.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v3.feed.post.create | `workspaceId: string | string[], postData: any, options?: any` |
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.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 | array | 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: [],
},
]);
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 | One of: user, activity.created, activity.updated. |
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 | |
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 | |
_metas | object | no | |
isStarred | boolean | no |
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):
| 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 | |
search | string | no | TEMPORARY 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
| Field | Type | Required | Description |
|---|---|---|---|
posts | object[] | yes | |
details | object | no |
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):
| 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?, 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? }.