UploadModel
Upload a single model using multipart/form-data
/openapi/model/UploadModel
Uploads a file into the folder node_uuid (the caller's own root when absent). When LookupModelHashes says the server has the file already, send its hash instead of the file part: no bytes travel. A hash the server cannot use after all answers NO_STREAM (404); send the file then. 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>Authorization: Bearer <auth token>
Accept: application/jsoncurl -X POST "$BIMWORKS_URL/openapi/model/UploadModel" \
-H "Authorization: Bearer $BIMWORKS_TOKEN" \
-F "file=@<file>" \
-F "node_uuid=<node_uuid>" \
-F "filename=<filename>" \
-F "filesize=<filesize>" \
-F "content_type=<content_type>" \
-F "input_file_type=<input_file_type>" \
-F "format_settings=<format_settings>" \
-F "hash=<hash>" \
-F "force_reprocessing=<force_reprocessing>" \
-F "tags=<tags>" \
-F "validation_settings=<validation_settings>" \
-F "wait_ms=<wait_ms>" \
-F "force=<force>"Examples#
curl -X POST "$BIMWORKS_URL/openapi/model/UploadModel" \
-H "Authorization: Bearer $BIMWORKS_TOKEN" \
-F "file=@<file>" \
-F "node_uuid=<node_uuid>" \
-F "filename=<filename>" \
-F "filesize=<filesize>" \
-F "content_type=<content_type>" \
-F "input_file_type=<input_file_type>" \
-F "format_settings=<format_settings>" \
-F "hash=<hash>" \
-F "force_reprocessing=<force_reprocessing>" \
-F "tags=<tags>" \
-F "validation_settings=<validation_settings>" \
-F "wait_ms=<wait_ms>" \
-F "force=<force>"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#
multipart/form-data
| Field | Type | Description |
|---|---|---|
file | fileoptional | A single uploaded model |
node_uuid | uuidoptional | The UUID of the Node to which to add the models |
filename | stringoptional | Name of the file Default model.ifc. |
filesize | integeroptional | Filesize in bytes Default -1. |
content_type | stringoptional | The content type. When available this information is taken from the Content-Type of the file part. Allowed values are application/ifc, application/xml (for .ifcxml files), application/pdf, application/e57 |
input_file_type | stringoptional | The type of the model (an InputFileType name). When present and not UNKNOWN it wins over the filename extension |
format_settings | stringoptional | A JSON-encoded PointCloudFormatSettings object (multipart form fields are strings) with per-upload point cloud format options |
hash | stringoptional | Instead of the file, its full_xxh64 (see ModelHash) when LookupModelHashes said the server knows it; ignored next to a file, which the server hashes itself. Needs filename |
force_reprocessing | booleanoptional | Process the file again, also when the server has processed the same file before Default false. |
tags | stringoptional | Tags of the new Version, comma-separated VersionTag names |
validation_settings | stringoptional | A JSON-encoded ValidationSettings object |
wait_ms | integeroptional | Answer 202 with the checkin's status when the checkin takes longer than this |
force | stringoptional | An UploadForce: NONE, NEW_VERSION or NEW_MODEL |
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 |
413 | ErrorResponse | The request body is larger than the server accepts (1 GB on a standard installation) |
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 |