ChannelService

Hierarchy

  • ChannelService

Methods

commentList

  • Get comment list.

    Parameters

    Returns Promise<FeedMessageComment[]>

    Comment list.

    const channelId = '55467104-fe1e- 4b20-9233-412a10bf3a10';
    const messageId = '55467104-fe1e- 4b20-9233-412a10bf3a10'; 
    const users = await System.users.search().size(2) .all(); 
    const options: FeedListOptions = { 
         from: 5, 
         size: 20,  
         filter: { 
             authors: users, 
         } 
    }; 
    const comments =  await System.feed.channel.commentList(channelId, messageId, options); 
    

createComment

  • createComment(channelId: string, messageId: string, body: string, options?: FeedPostOptions): Promise<string>
  • Create comment.

    Parameters

    • channelId: string
    • messageId: string
    • body: string
    • Optional options: FeedPostOptions

    Returns Promise<string>

    Unique comment identifier.

    const channelId = '55467104-fe1e- 4b20-9233-412a10bf3a10';
    const messageId = '55467104-fe1e- 4b20-9233-412a10bf4a11'; 
    const commentBody = 'Comment body'; 
    const users =  await System.users.search().size(2).all(); 
    const blob = new Blob (['file_text_content']); 
    const buf = await blob.arrayBuffer(); 
    const file  = await System.files.createTemporary('file.txt', buf); 
    const options:  FeedPostOptions = { 
         mentions: users, 
         tempFiles: [file], 
    };  
    const commentId = await System.feed.channel.createComment (channelId, messageId, commentBody, options); 
    

createMessage

  • createMessage(channelId: string, title: string | null, body: string, options?: FeedPostOptions): Promise<string>
  • Create message.

    Parameters

    • channelId: string
    • title: string | null
    • body: string
    • Optional options: FeedPostOptions

    Returns Promise<string>

    Unique message identifier.

    const channelId = '55467104-fe1e- 4b20-9233-412a10bf3a10';
    const messageTitle = 'Title'; 
    const messageBody =  'Message body'; 
    const users = await System.users.search().size(2).all();  
    const blob = new Blob(['file_text_content']); 
    const buf = await  blob.arrayBuffer(); 
    const file = await System.files.createTemporary ('file.txt', buf); 
    const options: FeedPostOptions = { 
         mentions:  users, 
         tempFiles: [file], 
    }; 
    const messageId = await  System.feed.channel.createMessage (channelId, messageTitle, messageBody, options); 
    

list

  • Get channel list.

    Parameters

    Returns Promise<FeedChannel[]>

    Channel list.

    const users = await System.users.search().size (2).all();
    const options: FeedListOptions = { 
         from: 1, 
         size: 2,  
         filter: { 
             name: 'HR', 
         } 
    }; 
    const channels = await  System.feed.channel.list(options); 
    

messageList

  • Get message list.

    Parameters

    Returns Promise<FeedMessage[]>

    Message list.

    const channelId = '55467104-fe1e- 4b20-9233-412a10bf3a10';
    const users = await System.users.search().size(2) .all(); 
    const options: FeedListOptions = { 
         from: 5, 
         size: 20,  
         filter: { 
             hasComments: true, 
             authors: users, 
          } 
    }; 
    const messages = await System.feed.channel.messageList (channelId, options);