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

Description

Provides access to the documents attached to one BCF topic.

const documents = await topic.documents.list();
const created = await topic.documents.create(fileBytes);

Public Member Functions

 create (documentData)
 list ()

Function Documentation

◆ create()

create ( documentData)

Uploads a document.

The server expects the raw binary body, not JSON.

Parameters
{Blob|ArrayBuffer|Uint8Array}documentData - Raw document body.
Returns
{Promise<ApiResponse>} The response containing the created document.
// Input: raw binary (application/octet-stream).
// Output:
{ "guid": "472ab37a-6122-448e-86fc-86503183b520", "filename": "Official_Building_Permission.pdf" }

◆ list()

list ( )
Returns
{Promise<ApiResponse>} The response containing the documents.
// Output:
[{
"guid": "472ab37a-6122-448e-86fc-86503183b520",
"filename": "LegalRequirements.pdf"
}, {
"guid": "6cbfe31d-95c3-4f4d-92a6-420c23698721",
"filename": "DesignParameters.pdf"
}]