Table of contents
Mesh Export
This API is a Technical Preview and is available for testing purposes only. Do not use in production.

Export

Download API definition:

GET https://api.bentley.com/mesh-export/[?$top][&$skip][&iModelId][&changesetId]

Returns a list of all exports previously requested by the user that have not expired and their statuses.

Authentication

Requires Authorization header with valid Bearer token for scope mesh-export:read.

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

Request parameters

Name
In
Required?
Description
$top
query
No

The $top system query option requests the number of items in the queried collection to be included in the result.

$skip
query
No

The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.

iModelId
query
No

The iModelId query parameter allows you to filter exports by a given iModel Id.

changesetId
query
No

The changesetId query parameter allows you to filter exports by a given changeset Id.

Request headers

Name
Required?
Description
Prefer
No

Indicates a level of details in the response. Valid values are 'return=representation' or 'return=minimal'. The default is 'return=minimal'.

Authorization
Yes

OAuth access token with scope mesh-export:read

Accept
No

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

Response 200 OK

List of user requested exports.

json
{
    "exports": [{
            "id": "fc3aa1e5-5196-4dd9-a73e-4cfda693e576",
            "displayName": "iModel Name",
            "status": "NotStarted"
        },
        {
            "id": "57ea169d-144a-4219-b530-9ce360fd194f",
            "displayName": "iModel Name",
            "status": "Complete"
        },
        {
            "id": "4777e39e-03a7-48b1-a5c1-4018beaefb25",
            "displayName": "iModel Name",
            "status": "Invalid"
        }
    ],
    "_links": {
        "self": {
            "href": "https://api.bentley.com/mesh-export/?$top=100&$skip=0"
        },
        "next": {
            "href": "https://api.bentley.com/mesh-export/?$top=100&$skip=100"
        }
    }
}

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 422 Unprocessable Entity

Cannot retrieve export.

json
{
    "error": {
        "code": "InvalidMeshExportRequest",
        "message": "Cannot retrieve export.",
        "details": [{
                "code": "InvalidParameter",
                "message": "$top must be lower or equal to 1000.",
                "target": "$top"
            },
            {
                "code": "InvalidParameter",
                "message": "iModelId is invalid.",
                "target": "iModelId"
            },
            {
                "code": "InvalidParameter",
                "message": "changesetId is invalid.",
                "target": "changesetId"
            }
        ]
    }
}

Response 429 Too many requests

This response indicates that the user has sent too many requests in a given amount of time.

json
{
    "error": {
        "code": "TooManyRequests",
        "message": "More requests were received than the subscription rate-limit allows."
    }
}

Response headers

Name
Description
retry-after

The number of requests exceeds the rate-limit for the client subscription.

Link

TableSchema
Name
Type
Description
href
String

Http reference

ExportListLinks

TableSchema
Name
Type
Description
self
prev
next

ViewDefinitionFilter

TableSchema
Name
Type
Description
models
String[]

Array of included model IDs.

categories
String[]

Array of included category IDs.

neverDrawn
String[]

Array of element IDs to filter out.

GeometryOptions

TableSchema
Name
Type
Description
includeLines
Boolean

Control whether linework is exported. If omitted, linework is included.

chordTol
Number

Max distance from a face to the original geometry.

angleTol
Number

Max angle difference in radians for approximated face.

decimationTol
Number

Max distance between mesh vertices for them to be collapsed.

maxEdgeLength
Number

Max length of any edge in generated faces.

minBRepFeatureSize
Number

BRep features with bounding boxes smaller than this size will not generate graphics.

minLineStyleComponentSize
Number

The longest dimension of a line style's largest component must be at least this size.

ExportListRepresentationResponse

TableSchema
Name
Type
Description
exports

Requested export list

ExportMinimal

TableSchema
Name
Type
Description
id
String

ID of the export request.

displayName
String

Name of the exported iModel.

status

Status of the export.

ExportStatus

Status of the export.

TableSchema
Name
Type
Description
No data.

Export

TableSchema
Name
Type
Description
id
String

ID of the export request.

displayName
String

Name of the exported iModel.

status

Status of the export.

request

Copy of the initial export request.

_links.mesh

URL where the result of the export is stored.

ExportListMinimalResponse

TableSchema
Name
Type
Description
exports

Requested export list minimal representation.

StartExport

TableSchema
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.

exportType
String

Type of mesh to create. Currently, only GLTF and 3DFT are supported.

geometryOptions

ExportGraphicsOptions. If omitted, use defaults from ExportGraphicsOptions.

viewDefinitionFilter

View filtering options to limit the scope of the export.

Error

Contains error information and an optional array of more specific errors.

TableSchema
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

The target of the error.

details

Optional array of more specific errors.

Error Details

Contains error information.

TableSchema
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

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.

TableSchema
Name
Type
Description
error

Error information.