AddModelWithUrl

Add a new model by providing a URL

POST
/openapi/model/AddModelWithUrl

The server fetches the file from url (within its egress policy) and checks it in under node_uuid. The checkin (parsing, geometry, indexing) follows the upload, which is always waited for. Without wait_ms the call answers when the checkin ends, with the new Version, which for a big model can take longer than a gateway waits. With wait_ms it answers the Version when the checkin ends within that many milliseconds, and otherwise 202 with the checkin's status and job_uuid: follow it with GetCheckin. A checkin still running after an hour answers 202 too. A ZIP of models is checked in where it was received and has no job, so it always waits. The same file name in the same folder adds a Version to that model.

Try it#

Edit the request and send it; it runs against this instance with your token, and the examples follow the form.

Authorization
Bearer <auth token>
Content-Type
application/json
Body
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Authorization: Bearer <auth token>
Content-Type: application/json
Accept: application/json
curl -X POST "$BIMWORKS_URL/openapi/model/AddModelWithUrl" \
  -H "Authorization: Bearer $BIMWORKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "path": "",
  "filename": "",
  "url": "",
  "input_file_type": "IFC",
  "format_settings": {},
  "force_reprocessing": false,
  "tags": [
    "DEMO"
  ],
  "validation_settings": {},
  "wait_ms": 0,
  "force": "NONE"
}'
Send to see the response

Examples#

curlshell
curl -X POST "$BIMWORKS_URL/openapi/model/AddModelWithUrl" \
  -H "Authorization: Bearer $BIMWORKS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "path": "",
  "filename": "",
  "url": "",
  "input_file_type": "IFC",
  "format_settings": {},
  "force_reprocessing": false,
  "tags": [
    "DEMO"
  ],
  "validation_settings": {},
  "wait_ms": 0,
  "force": "NONE"
}'

The examples are complete programs in the OpenAPI SDKs, all in the same four steps. The method in each SDK's reference: Java · .NET · TypeScript · PHP · Python.

Request body#

AddModelWithUrlRequest · application/json

FieldTypeDescription
node_uuiduuidoptionalThe UUID of the Node to which to add the model
pathstringoptionalInstead of node_uuid, the path of the folder, from the caller's root
filenamestringoptionalName of the file; the last segment of the URL's path when absent
urlstringrequiredURL to get the model
input_file_typeInputFileTypeoptionalThe type of the model. When present and not UNKNOWN it wins over the filename extension - the route for correcting misnamed files or extension-less URLs One of IFC, E57, PDF, PLY_ASCII, LAZ, LAS, TEST, ZIP, BCF, UNKNOWN, FOLDER, GLB, GLTF, IFCX, DWG.
format_settingsPointCloudFormatSettingsoptional

Per-upload options for point cloud formats, applied when the uploaded model is a point cloud (LAS and LAZ share one option table; E57 takes only include_classifications). Every option has a sensible default that detection fills in - pass only what detection got wrong. Unknown keys are rejected. The resolved effective settings (defaults + detection + these overrides, plus detection warnings) are persisted in the model's im_metadata under pointCloud.

LAS / LAZ options (LAZ is LASzip-compressed LAS: same header, same records, decoded chunk by chunk; the effective settings additionally record laszip_compressor, laszip_version, laszip_chunk_size, laszip_chunks, laszip_items and, for COPC files, the copc octree parameters):

  • unit: linear unit of the coordinates after scale/offset - "mm", "cm", "m", "ft", "usft". Default: from the CRS VLR, else metres.
  • rgb_source: "auto" (RGB if present and non-zero, else intensity, else default_color), "rgb", "intensity" or "none". Default "auto".
  • color_bit_depth: "auto" (sample-based), 8 or 16. The LAS spec says RGB is 0-65535 but many writers store 0-255. Default "auto".
  • intensity_range: "auto" (sampled min/max maps to 0-255 grayscale) or [min, max].
  • exclude_withheld: drop points flagged Withheld. Default true.
  • include_classifications: array of ASPRS class codes to keep, e.g. [2, 6] (ground, building). Default: all.
  • default_color: "#rrggbb" used when no RGB and no intensity. Default "#ffffff".

E57 option:

  • include_classifications: as for LAS, for an E57 whose points carry a classification field (as PDAL's LAS-to-E57 export writes); rejected when no scan has one. The effective settings list the per-point fields and the skipped_fields BIM.works does not use.
force_reprocessingbooleanoptionalProcess the file again, also when the server has processed the same file before Default false.
tagsarray of VersionTagoptionalTags of the new Version
validation_settingsValidationSettingsoptionalHow the IFC validation of a checkin reports its findings
wait_msintegeroptionalAnswer 202 with the checkin's status when the checkin takes longer than this
forceUploadForceoptionalFor an upload onto a model Node under another file name, NEW_MODEL makes the file a model of its own in the model's folder (which needs write rights on the folder); NONE and NEW_VERSION make it the model's next Version

Responses#

StatusSchemaDescription
200ModelVersionUpload was successful
202CheckinStatusThe checkin is still running (after wait_ms, or after an hour without it); follow it with GetCheckin
400ErrorResponseInvalid input: a missing or invalid argument, an invalid query/identifier/path, a state conflict caused by the request (for example a Node name that already exists), or an uploaded file that was rejected because it cannot be read (type for example INVALID_INPUT_FILE, NO_CONVERTIBLE_CONTENT or one of the StepParserErrorCode codes; uploading the same file again fails the same way)
401ErrorResponseAuthentication failed: the bearer token is missing, malformed, expired or otherwise invalid, or the provided login credentials are incorrect
403ErrorResponseAuthenticated, but not allowed: no read/write rights on the target Node, the token's task or IP scope does not allow this call, or a required user feature is missing
404ErrorResponseThe referenced entity (Node, Version, model file, upload, ...) does not exist
429ErrorResponseToo many requests from this client in a short time, on an installation that limits the request rate. Wait the number of seconds in Retry-After before trying again
500ErrorResponseAn unexpected server-side error (database, routing, IO, unknown)
503ErrorResponseBIM.works is temporarily unavailable: it is restarting, stopped, or down for scheduled maintenance (type SERVICE_UNAVAILABLE or MAINTENANCE). Wait the number of seconds in Retry-After before trying again
504ErrorResponseBIM.works did not respond in time (type REQUEST_TIMED_OUT). The request may still be completed: check its result before trying again
Generated from api.yml·openapi.json