Mesh Export
Download API definition:
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
POST https://api.bentley.com/mesh-export/

Start a mesh export from the iModel. The exports will remain available until they are deleted.

Deprecation

Recently, the iTwin platform incorporated the ability to auto-generate 3D Tiles when iModels change. Therefore, it is no longer necessary to manually generate the tiles, as the platform will handle it.

In the future, all tiles will be generated automatically, and the ability to generate them manually will be deprecated.

Therefore, we advise against using this functionality or deprecating it as soon as possible if you are currently using it.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v1+json is recommended.

Request body

StartExport

Name
Type
Required?
Description
iModelId
String
Yes

ID of the iModel to extract from.

changesetId
String
Yes

ID of the changeset to extract from. If omitted, export latest.

StartExport exportType
No

Type of mesh to create, Accepted value are 3DFT, CESIUM, IMODEL and 3DTiles

lastModified
Date-time
No

Date when job metadata was last modified

Example

json
{
    "iModelId": "b80f4fc2-4dbb-42c5-bb1f-f5aace3977dc",
    "changesetId": "ed94ed9a0704918d36eeb620219f5e17d8858858",
    "exportType": "3DTiles"
}

Response 202 Accepted

The export was accepted and will be processed

json
{
    "export": {
        "id": "fc3aa1e5-5196-4dd9-a73e-4cfda693e576",
        "displayName": "My iModel",
        "status": "NotStarted",
        "lastModified": "2024-08-22T03:18:43Z",
        "request": {
            "iModelId": "b80f4fc2-4dbb-42c5-bb1f-f5aace3977dc",
            "changesetId": "ed94ed9a0704918d36eeb620219f5e17d8858858",
            "exportType": "3DTiles",
            "lastModified": "2024-08-22T03:18:43Z"
        }
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 403 Forbidden

The user has insufficient permissions for the requested operation.

json
{
    "error": {
        "code": "InsufficientPermissions",
        "message": "The user has insufficient permissions for the requested operation."
    }
}

Response 422 Unprocessable Entity

Cannot create export job.

json
{
    "error": {
        "code": "InvalidMeshExportRequest",
        "message": "Cannot create export job.",
        "details": [{
            "code": "InvalidRequestBody",
            "message": "iModelId cannot be empty.",
            "target": "iModelId"
        }]
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Link

Name
Type
Description
href
String

Http reference

ExportResponse

Name
Type
Description
export

ExportStatus

Status of the export.

Name
Type
Description
NotStarted
String
InProgress
String
Complete
String
Invalid
String

ExportStatsDisplay

Statistics of the export job. This obsoletes the Consumption type.

Name
Type
Description
iModelSize
Number

Size of the iModel .bin file, in bytes

compressedSize
Number

Size of the exported and compressed tiles, in bytes.

rawSize
Number

Size of the exported tiles, in bytes.

startTime
Date-time

Starting date of the export job, pretty-printed.

duration
Number

Duration of the export job, in milliseconds.

metrics
Object

Export

Name
Type
Description
id
String

ID of the export request.

displayName
String

Name of the exported iModel

lastModified
String

Date when job metadata was last modified

error
String

Error message for Invalid exports.

_links.mesh

StartExport exportType

Type of mesh to create, Accepted value are 3DFT, CESIUM, IMODEL and 3DTiles

Name
Type
Description
3DFT
String
IMODEL
String
CESIUM
String
3DTiles
String

StartExport

Name
Type
Description
iModelId
String

ID of the iModel to extract from.

changesetId
String

ID of the changeset to extract from. If omitted, export latest.

StartExport exportType

Type of mesh to create, Accepted value are 3DFT, CESIUM, IMODEL and 3DTiles

lastModified
Date-time

Date when job metadata was last modified

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?