Infohub JS API
Loading...
Searching...
No Matches
BcfCommentsResource Class Reference

Description

Provides access to the comments of one BCF topic.

const comments = await topic.comments.list();
const created = await topic.comments.create({ comment: "Resolved" });

Public Member Functions

 create (commentData)
 list (query={})

Function Documentation

◆ create()

create ( commentData)
Parameters
{object}commentData - Comment creation data (comment required, viewpoint_guid and reply_to_comment_guid optional).
Returns
{Promise<ApiResponse>} The response containing the created comment.
// Input:
{ "comment": "will rework the heating model" }
// Output:
{
"guid": "A333FCA8-1A31-CAAC-A321-BB33ABC8414",
"date": "2016-08-01T14:24:11.316Z",
"author": "bob.heater@example.com",
"comment": "will rework the heating model",
"topic_guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228"
}

◆ list()

list ( query = {})
Parameters
{object}[query] - Optional list query.
{string}[query.filter] - Raw BCF/OData $filter expression (e.g. author eq 'max.muster@example.com').
Returns
{Promise<ApiResponse>} The response containing the comments.
// Output:
[{
"guid": "C4215F4D-AC45-A43A-D615-AA456BEF832B",
"date": "2016-08-01T12:34:22.409Z",
"author": "max.muster@example.com",
"comment": "Clash found",
"topic_guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228",
"authorization": { "comment_actions": ["update"] }
}]