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

Description

Represents one topic-scoped BCF API resource.

const topic = project.topic(topicId);
await topic.get();
await topic.update({ topic_status: "Closed" });
await topic.delete();

Public Member Functions

 comment (commentId)
get comments ()
 delete ()
 documentReference (documentReferenceId)
get documentReferences ()
get documents ()
get events ()
get files ()
 get ()
get relatedTopics ()
get snippet ()
 update (topicData)
 viewpoint (viewpointId)
get viewpoints ()

Function Documentation

◆ comment()

comment ( commentId)

Selects a comment on this topic.

Parameters
{string}commentId - BCF comment identifier.
Returns
{BcfCommentResource} The comment resource.

◆ comments()

get comments ( )

Gets this topic's comment collection.

Returns
{BcfCommentsResource} The comment collection resource.

◆ delete()

delete ( )
Returns
{Promise<ApiResponse>} Status only, no payload.
// No request body. Output: HTTP 200, no payload.

◆ documentReference()

documentReference ( documentReferenceId)

Selects a document reference on this topic.

Parameters
{string}documentReferenceId - BCF document-reference identifier.
Returns
{BcfDocumentReferenceResource} The document-reference resource.

◆ documentReferences()

get documentReferences ( )

Gets this topic's document-reference collection (links to a Document-or-URL).

Returns
{BcfDocumentReferencesResource} The document-reference collection resource.

◆ documents()

get documents ( )

Gets this topic's document collection.

Documents are uploaded/listed via this route, but stored at PROJECT level - topicId in the URL is only validated, not the storage parent.

Returns
{BcfDocumentsResource} The document collection resource.

◆ events()

get events ( )

Gets this topic's event collection.

Returns
{BcfListResource} A listable resource.
// Output of events.list():
[{
"topic_guid": "A245F4F2-2C01-B43B-B612-5E456BEF8116",
"date": "2014-11-19T14:24:11.316Z",
"author": "Architect@example.com",
"events": [{ "type": "type_updated", "value": "Error" }]
}]

◆ files()

get files ( )

Gets the files referenced by this topic (IFC model pointers, not binaries - see BcfTopicResource#documents for uploaded binaries).

Returns
{BcfListReplaceResource} list() reads it, replace(fileData) replaces the whole collection.
// Output of files.list() and files.replace(fileData):
[{
"ifc_project": "0J$yPqHBD12v72y4qF6XcD",
"file_name": "OfficeBuilding_Architecture_0001.ifc",
"reference": "https://example.com/files/0J$yPqHBD12v72y4qF6XcD_0001.ifc"
}]
// Input of files.replace(fileData):
[{
"ifc_project": "0J$yPqHBD12v72y4qF6XcD",
"filename": "OfficeBuilding_Architecture_0001.ifc",
"reference": "https://example.com/files/0J$yPqHBD12v72y4qF6XcD_0001.ifc"
}]

◆ get()

get ( )
Returns
{Promise<ApiResponse>} The response containing the topic.
// Output:
{
"guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228",
"server_assigned_id": "ISSUE-00549",
"creation_author": "Architect@example.com",
"creation_date": "2016-08-01T17:34:22.409Z",
"topic_type": "Clash",
"topic_status": "open",
"title": "Example topic 3",
"priority": "high",
"labels": ["Architecture", "Heating"],
"assigned_to": "harry.muster@example.com",
"authorization": { "topic_actions": ["createComment", "createViewpoint"] }
}

◆ relatedTopics()

get relatedTopics ( )

Gets the topics related to this topic.

Returns
{BcfListReplaceResource} list() reads it, replace(relatedTopicsData) replaces the whole collection.
// Output of relatedTopics.list():
[{ "related_topic_guid": "db49df2b-0e42-473b-a3ee-f7b785d783c4" }]
// Input of relatedTopics.replace(relatedTopicsData):
[
{ "related_topic_guid": "db49df2b-0e42-473b-a3ee-f7b785d783c4" },
{ "related_topic_guid": "bac66ab4-331e-4f21-a28e-083d2cf2e796" }
]
// Output of relatedTopics.replace(relatedTopicsData):
[
{ "related_topic_guid": "db49df2b-0e42-473b-a3ee-f7b785d783c4" },
{ "related_topic_guid": "bac66ab4-331e-4f21-a28e-083d2cf2e796" }
]

◆ snippet()

get snippet ( )

Gets the topic's BIM snippet - singular, a topic has at most one.

Returns
{BcfGetReplaceResource} get() reads it, replace(binaryData) uploads raw bytes (application/octet-stream).
// Output of snippet.get(): raw binary (application/octet-stream).
// Input of snippet.replace(binaryData): raw binary (application/octet-stream).
// Output of snippet.replace(binaryData): HTTP 200, no payload.

◆ update()

update ( topicData)

Partial update: only fields present in the body are touched.

Parameters
{object}topicData - Topic fields to update.
Returns
{Promise<ApiResponse>} The response containing the updated topic.
// Input:
{ "title": "Example topic 3 - Changed Title" }
// Output:
{
"guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228",
"server_assigned_id": "ISSUE-00037",
"creation_author": "Architect@example.com",
"creation_date": "2016-08-01T17:34:22.409Z",
"modified_author": "Architect@example.com",
"modified_date": "2016-08-02T13:22:22.409Z",
"topic_type": "Clash",
"topic_status": "open",
"title": "Example topic 3 - Changed Title",
"priority": "high"
}

◆ viewpoint()

viewpoint ( viewpointId)

Selects a viewpoint on this topic.

Parameters
{string}viewpointId - BCF viewpoint identifier.
Returns
{BcfViewpointResource} The viewpoint resource.

◆ viewpoints()

get viewpoints ( )

Gets this topic's viewpoint collection.

Returns
{BcfViewpointsResource} The viewpoint collection resource.