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

Description

Provides access to the document references of one BCF topic.

const references = await topic.documentReferences.list();
const created = await topic.documentReferences.create({ url: "https://example.com" });

Public Member Functions

 create (documentReferenceData)
 list ()

Function Documentation

◆ create()

create ( documentReferenceData)

Either/or, never both: document_guid points at a Document already uploaded to this project (see BcfTopicResource#documents); url is any external link.

Parameters
{object}documentReferenceData - document_guid XOR url, plus optional description.
Returns
{Promise<ApiResponse>} The response containing the created reference.
// Input:
{
"url": "http://example.com/files/LegalRequirements.pdf",
"description": "The legal requirements for buildings."
}
// Output:
{
"guid": "275ab37a-6122-448e-86fc-86503183b520",
"url": "http://example.com/files/LegalRequirements.pdf",
"description": "The legal requirements for buildings."
}

◆ list()

list ( )
Returns
{Promise<ApiResponse>} The response containing the references.
// Output:
[{
"guid": "212ab37a-6122-448e-86fc-86503183b520",
"url": "http://example.com/files/LegalRequirements.pdf",
"description": "The legal requirements for buildings."
}, {
"guid": "6cbfe31d-95c3-4f4d-92a6-420c23698721",
"document_guid": "472ab37a-6122-448e-86fc-86503183b520",
"description": "The building owners global design parameters for buildings."
}]