Table of contents
Clash Detection
Download API definition:
POST https://api.bentley.com/clash-detection/itwins/{itwinId}/runs/jobs

Runs clash detection tests for the specified job ids (test ids) [currently restricted to one test run per request] and returns the clash report ids. The maximum number of clashes can be specified with the resultsLimit parameter in the request body. If none is specified, the default is 100,000.

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 parameters

Name
Required?
Description
itwinId
Yes

The iTwin Id

Request headers

Name
Required?
Description
In-Place
No

False: create new clash results in subsequent runs for the combination of TestId, iModelId and namedVersionId; True: update the existing clash results in subsequent runs for the combination of TestId, iModelId and namedVersionId; Force: run the clash test on same combination.

Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

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

Request body

Run Clash Detection Test

Name
Type
Required?
Description
jobs
Yes

Array of clash detection tests with details to be run.

operation
String
Yes

The operation to be performed. Possible values: run.

Example

json
{
    "jobs": [{
        "testId": "c6263303-8d04-44c1-a769-675fb763c412",
        "iModelId": "72520c09-d3ad-4cc5-aac3-bb5fb256d45e",
        "changesetId": "380bba8d-fed2-4971-818c-112d010dfbe5",
        "testSettings": {
            "resultsLimit": "10000"
        }
    }],
    "operation": "run"
}

Response 200 OK

OK

json
{
    "runs": [{
        "testId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "clashReportId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "status": "Completed"
    }]
}

Response 400 Bad Request

The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidClashDetectionRequest",
        "message": "Invalid clash detection request.",
        "details": [{
                "code": "InvalidRequestBody",
                "message": "Required property 'iModelId' is missing in the request body.",
                "target": "iModelId"
            },
            {
                "code": "InvalidRequestBody",
                "message": "Required property 'changesetId' is missing in the request body.",
                "target": "changesetId"
            },
            {
                "code": "InvalidRequestBody",
                "message": "Required property 'testId' is missing in the request body.",
                "target": "testId"
            },
            {
                "code": "InvalidRequestBody",
                "message": "Request body was not provided."
            },
            {
                "code": "InvalidRequestBody",
                "message": "The request is invalid."
            },
            {
                "code": "InvalidRequestBody",
                "message": "The request body is not a valid JSON object."
            }
        ]
    }
}

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 404 Not Found

This response indicates that the specified iTwin was not found.

json
{
    "error": {
        "code": "iTwinNotFound",
        "message": "Requested iTwin is not available."
    }
}

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.

Clash Detection Run

Run metadata.

Name
Type
Description
testId
String

The test id associated with the run.

iModelId
String

The iModel id for which the test is to be run.

changesetId
String

The changeset id for which the test is to be run.

testSettings

Settings to run the clash detection test.

Clash Detection Run

Clash detection run.

Name
Type
Description
runs

The status details of clash detection runs.

Clash Detection Run Status Details

Name
Type
Description
clashReportId
String

The result/clash-report id for the requested clash detection test run.

testId
String

The test id associated with the run.

status
String

The status associated with the run.

Clash Detection Test Settings

Name
Type
Description
resultsLimit
One of: numberstring

The maximum clash/failure limit for the clash detection test. Default is 100000.

Run Clash Detection Test

Specify the test/configuration id, iModel id and changeset id to run clash detection test.

Name
Type
Description
jobs

Array of clash detection tests with details to be run.

operation
String

The operation to be performed. Possible values: run.

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?