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.
-
This API has a rate limit of 6 API calls per second. If an application exceeds the rate limit it will receive an HTTP error code 429 "Too Many Requests". The error response includes a Retry-After header that indicates how long clients should wait before retrying.
-
To retrieve the run status as the agent job completes asynchronously, use the clash report id to call GET /clash-detection/itwins/{itwinId}/reports/{id}
-
Discover test ids by calling GET /clash-detection/itwins/{itwinId}/tests
-
Discover iModel ids by calling GET /imodels/?iTwinId
-
Discover changeset ids by calling GET /imodels/{id}/changesets
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
The iTwin Id
Request headers
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.
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v2+json
is recommended.
Request body
Run Clash Detection Test
The operation to be performed. Possible values: run.
Example
{ "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
{ "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)
{ "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.
{ "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.
{ "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.
{ "error": { "code": "RateLimitExceeded", "message": "The client sent more requests than allowed by this API for the current tier of the client." } }
Response headers
Number of seconds to wait until client is allowed to make more requests.
Clash Detection Run
Run metadata.
The test id associated with the run.
The iModel id for which the test is to be run.
The changeset id for which the test is to be run.
{ "title": "Clash Detection Run", "type": "object", "description": "Run metadata.", "properties": { "testId": { "type": "string", "description": "The test id associated with the run." }, "iModelId": { "type": "string", "description": "The iModel id for which the test is to be run." }, "changesetId": { "type": "string", "description": "The changeset id for which the test is to be run." }, "testSettings": { "$ref": "#/components/schemas/clash-detection-test-settings", "description": "Settings to run the clash detection test." } }, "additionalProperties": false }
Clash Detection Run
Clash detection run.
{ "title": "Clash Detection Run", "type": "object", "description": "Clash detection run.", "properties": { "runs": { "type": "array", "items": { "$ref": "#/components/schemas/clash-detection-run-status" }, "description": "The status details of clash detection runs." } }, "additionalProperties": false }
Clash Detection Run Status Details
The result/clash-report id for the requested clash detection test run.
The test id associated with the run.
The status associated with the run.
{ "title": "Clash Detection Run Status Details", "type": "object", "properties": { "clashReportId": { "type": "string", "description": "The result/clash-report id for the requested clash detection test run." }, "testId": { "type": "string", "description": "The test id associated with the run." }, "status": { "type": "string", "description": "The status associated with the run." } }, "additionalProperties": false }
Clash Detection Test Settings
{ "title": "Clash Detection Test Settings", "type": "object", "properties": { "resultsLimit": { "oneOf": [ { "type": "number" }, { "type": "string" } ], "description": "The maximum clash/failure limit for the clash detection test. Default is 100000." } }, "additionalProperties": false }
Run Clash Detection Test
Specify the test/configuration id, iModel id and changeset id to run clash detection test.
The operation to be performed. Possible values: run.
{ "title": "Run Clash Detection Test", "type": "object", "description": "Specify the test/configuration id, iModel id and changeset id to run clash detection test.", "properties": { "jobs": { "type": "array", "description": "Array of clash detection tests with details to be run.", "items": { "$ref": "#/components/schemas/clash-detection-run" } }, "operation": { "type": "string", "description": "The operation to be performed. Possible values: run." } }, "additionalProperties": false, "required": [ "jobs", "operation" ] }
DetailedError
Contains error information and an array of more specific errors.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information and an array of more specific errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true }, "details": { "type": "array", "description": "Optional array of more specific errors.", "items": { "$ref": "#/components/schemas/Error" } } }, "required": [ "code", "message", "details" ], "additionalProperties": true }
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.
{ "type": "object", "title": "Detailed Error Response", "description": "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.", "properties": { "error": { "description": "Error Detailed information.", "$ref": "#/components/schemas/DetailedError" } }, "required": [ "error" ], "additionalProperties": false }
Error
Contains error information.
One of a server-defined set of error codes.
A human-readable representation of the error.
The target of the error.
{ "type": "object", "description": "Contains error information.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error.", "nullable": true } }, "required": [ "code", "message" ], "additionalProperties": true }
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.
{ "type": "object", "title": "Error Response", "description": "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.", "properties": { "error": { "description": "Error information.", "$ref": "#/components/schemas/Error" } }, "required": [ "error" ], "additionalProperties": false }
Was this page helpful?