APIJavaScript · Java · .NET · PHP · Python

Introduction

The HTTP API of a BIM.works instance — base URL, the OpenAPI document, request and response conventions, the runnable operation pages, and where the API stops.

Every BIM.works instance serves an OpenAPI 3.1 document and the operations it describes. It is the way in for everything that is not a JavaScript, Java or .NET SDK: curl, a backend in another language, an integration platform, and the generated PHP client. Every operation has a page in this part with a request you can edit and execute.

Base URL and document#

Operations live under <app>/openapi, where <app> is the instance's public URL including its base path. For example: https://bim.works/openapi/ifc/Query, https://client.bim.works/bw/openapi/fs/GetNode. The document is at <app>/openapi.json (also openapi.yaml), and Swagger UI is served next to it with the same document.

Conventions#

  • Almost every operation is a POST with a JSON body, and the path is the tag and the operation id: /auth/LoginWithApiToken, /fs/ListNodes, /ifc/Query. The GET calls are GetRootNodeUuid and Version.
  • Field names are snake_case (node_uuid, version_uuid, response_format); paths in a request are relative to the token's root node.
  • Models are addressed with a api/schemas#ModelIdentifier: a version, or the latest versions under a node (optionally recursive). Query, check and compare take arrays of them. The schema also has a URL identifier, which is not resolved yet.
  • Uploads are multipart/form-data (UploadModel); AddModelWithUrl fetches the file instead.
  • An operation that answers in more than one format takes a format field, and each value names its content type in the operation's page: Download (the original file, IFC or ifcXML), Query (records, a count, a selection, a table, or the objects as IFC or ifcXML, output#ifc), Check (results, a summary or BCF), GetCompareResult and ExportCityGML3. format wins over the Accept header, which is only read when format is absent: a generated client sends Accept: application/json on every call.
  • Downloads stream the file (Download, DownloadAsZip). Download converts an IFC2X3 model to IFC4 when the request names a target_schema; what the conversion lost and added is counted in the response headers and listed by SchemaConversionReport.
  • A stored action runs by reference: Query and Check take an action_uuid (and optionally its action_version) instead of the query or check text. That needs read rights on the action and the operation's own Scope, not actions:read.
  • Calls run synchronously: a transaction (CommitTransaction) returns when the new version exists. Two can answer early instead. An upload with wait_ms answers 202 and a job_uuid while the checkin runs, which GetCheckin follows (Upload a model). CompareModels with options.wait_ms answers 202 with status: RUNNING and a result_uuid when the compare is still running after that time; it goes on in the background, and GetCompareResult reads the result later.
  • Browser calls are answered with the CORS headers the instance is configured for, so a fetch preflight succeeds.

Groups#

The rail groups the operations as the OpenAPI document does; a group's name opens its first operation.

GroupDescriptionOperations
Auth - AuthenticationAuthentication and authorization related calls such as for logging in and creating authentication tokens.13
Fs - FileSystemBIM.works repository's virtual filesystem related calls.16
ModelCalls related to models, for example to upload or download models12
VersionsCalls related to Versions1
IFC - Industry Foundation ClassesIFC related calls, for example queries and model checks21
GIS - Geographic Information SystemsGIS related calls, for example to export to CityGML6
AI - Artificial IntelligenceNatural-language calls, for example to turn a sentence into a BQL query, a BVL visualisation or a BCL check1
AccountThe signed-in account: registration, password, sessions and settings10
AdminThe administration of an organization: its accounts and features3
ActionsStored queries, checks, visualizations and other actions, which Query and Check run by uuid6
WorkspacesCurated views on a folder for visitors of the BIM.works web app, and their share links5
InfoGeneral information about the instance1
ViewerWhat the viewers need to place and load models1
Linked dataFiles, URLs, texts and identifiers linked to objects, which follow their objects to later Versions15

Trying an operation#

Every operation page carries an executor: edit the request, press Send, read the status, timing and body. When you are signed in to this instance in the same browser it uses your account's demo API token, so placeholders such as BIM_WORKS_FIRST_MODEL resolve to your demo models; a token pasted into the block is used instead. The example under the executor follows the form, in the language chosen in the bar.

Limits#

The OpenAPI covers the repository operations: authentication, API tokens and delegated tokens, the account and the organization's administration, the node tree, uploads and downloads, queries, checks, comparisons, transactions, the stored actions, workspaces, georeferencing, CityGML and glTF export, renders and BCF snapshots. The task API behind the SDKs has more (the viewer's geometry streams, chat). The result of Query follows the query, so its shape is described in prose (Output) rather than by a schema.