AddModelWithUrl
Add a new model by providing a URL
/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.
Bearer <auth token>application/jsonAuthorization: Bearer <auth token>
Content-Type: application/json
Accept: application/jsoncurl -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"
}'Examples#
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
| Field | Type | Description |
|---|---|---|
node_uuid | uuidoptional | The UUID of the Node to which to add the model |
path | stringoptional | Instead of node_uuid, the path of the folder, from the caller's root |
filename | stringoptional | Name of the file; the last segment of the URL's path when absent |
url | stringrequired | URL to get the model |
input_file_type | InputFileTypeoptional | The 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_settings | PointCloudFormatSettingsoptional | 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 LAS / LAZ options (LAZ is LASzip-compressed LAS: same header, same records, decoded chunk by chunk; the effective settings additionally record
E57 option:
|
force_reprocessing | booleanoptional | Process the file again, also when the server has processed the same file before Default false. |
tags | array of VersionTagoptional | Tags of the new Version |
validation_settings | ValidationSettingsoptional | How the IFC validation of a checkin reports its findings |
wait_ms | integeroptional | Answer 202 with the checkin's status when the checkin takes longer than this |
force | UploadForceoptional | For 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#
| Status | Schema | Description |
|---|---|---|
200 | ModelVersion | Upload was successful |
202 | CheckinStatus | The checkin is still running (after wait_ms, or after an hour without it); follow it with GetCheckin |
400 | ErrorResponse | Invalid 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) |
401 | ErrorResponse | Authentication failed: the bearer token is missing, malformed, expired or otherwise invalid, or the provided login credentials are incorrect |
403 | ErrorResponse | Authenticated, 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 |
404 | ErrorResponse | The referenced entity (Node, Version, model file, upload, ...) does not exist |
429 | ErrorResponse | Too 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 |
500 | ErrorResponse | An unexpected server-side error (database, routing, IO, unknown) |
503 | ErrorResponse | BIM.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 |
504 | ErrorResponse | BIM.works did not respond in time (type REQUEST_TIMED_OUT). The request may still be completed: check its result before trying again |