Job Creation
Creates a comparison job. The comparison will be queued when first created and will progress to completion. When completed, you can use Get Comparison Job to query the results.
Webhooks
Once a job is finished, an event is triggered via the Webhooks API. All subscribers of the changeElements.jobCompleted.v1 event type will be notified.
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
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v2+json
is recommended.
Request body
ComparisonRequest
Id of the iTwin where the iModel resides.
Id of the iModel to query for status of changesets.
Id of the changeset to start from. This changeset must occur before end changeset.
Id of the changeset to end at. This changeset must occur after start changeset.
Example
{ "iTwinId": "e74dc7ec-bc23-41c9-b838-6833f77dc05f", "iModelId": "ca3746e1-854c-477c-bde3-e6cd7590d6da", "startChangesetId": "1ff311f3-ae9d-48f4-b663-9e28fbf1aeaa", "endChangesetId": "5ea41523-fbfd-46e8-be7f-d30c68343a9e" }
Response 202 Accepted
Created comparison.
{ "comparisonJob": { "status": "Queued", "jobId": "16063aa71dfbcee75d32a7c5a31ca40e9bb2b094-8968f5c4449d26c0dababf37aed17dcc49d7059f", "iTwinId": "1036c64d-7fbe-47fd-b03c-4ed7ad7fc829", "iModelId": "0db82dc1-e871-4209-b40a-6753c6a68c19", "startChangesetId": "16063aa71dfbcee75d32a7c5a31ca40e9bb2b094", "endChangesetId": "8968f5c4449d26c0dababf37aed17dcc49d7059f" } }
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 403 Forbidden
The user has insufficient permissions for the requested operation.
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
This response indicates that the provided iTwin, iModel, or changeset ids could not be found.
{ "error": { "code": "ComparisonNotFound", "message": "Requested comparison is not available." } }
Response 409 Conflict
Comparison with these start and end changeset ids already exists.
{ "error": { "code": "ComparisonExists", "message": "Comparison with these start and end changeset ids already exists." } }
Response 422 Unprocessable Entity
Cannot create comparison. Likely due to the request payload having an invalid field(s).
{ "error": { "code": "InvalidChangedElementsRequest", "message": "Can not create comparison.", "details": [{ "code": "MissingRequiredProperty", "message": "Required property 'iModelId' is missing.", "target": "iModelId" }, { "code": "MissingRequiredProperty", "message": "Required property 'iTwinId' is missing.", "target": "iTwinId" }, { "code": "MissingRequiredProperty", "message": "Required property 'startChangesetId' is missing.", "target": "startChangesetId" }, { "code": "MissingRequiredProperty", "message": "Required property 'endChangesetId' is missing.", "target": "endChangesetId" } ] } }
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.
Create Comparison Response
A response containing information regarding the newly created comparison.
{ "type": "object", "title": "Create Comparison Response", "description": "A response containing information regarding the newly created comparison.", "properties": { "comparisonJob": { "$ref": "#/components/schemas/NewComparison", "description": "Details for the new comparison." } }, "additionalProperties": false }
NewComparison
Information related to the new comparison.
A string reflecting the status of the comparison. The statuses are: Queued, Started, Completed, or Failed.
Comprised of start changeset Id and end changeset Id in the following format {startChangesetId}-{endChangesetId}.
Id of the iTwin where the iModel resides.
Id of the iModel to query for status of changesets.
Id of the changeset to start from. This changeset must occur before end changeset.
Id of the changeset to end at. This changeset must occur after start changeset.
{ "type": "object", "description": "Information related to the new comparison.", "properties": { "status": { "type": "string", "description": "A string reflecting the status of the comparison. The statuses are: Queued, Started, Completed, or Failed." }, "jobId": { "type": "string", "description": "Comprised of start changeset Id and end changeset Id in the following format {startChangesetId}-{endChangesetId}." }, "iTwinId": { "type": "string", "description": "Id of the iTwin where the iModel resides." }, "iModelId": { "type": "string", "description": "Id of the iModel to query for status of changesets." }, "startChangesetId": { "type": "string", "description": "Id of the changeset to start from. This changeset must occur before end changeset." }, "endChangesetId": { "type": "string", "description": "Id of the changeset to end at. This changeset must occur after start changeset." } }, "additionalProperties": false }
ComparisonRequest
A payload for creating a new comparison. The comparison payload must have an iTwinId, iModelId, startChangesetId, endChangesetId.
Id of the iTwin where the iModel resides.
Id of the iModel to query for status of changesets.
Id of the changeset to start from. This changeset must occur before end changeset.
Id of the changeset to end at. This changeset must occur after start changeset.
{ "type": "object", "description": "A payload for creating a new comparison. The comparison payload must have an iTwinId, iModelId, startChangesetId, endChangesetId.", "required": [ "iTwinId", "iModelId", "startChangesetId", "endChangesetId" ], "properties": { "iTwinId": { "type": "string", "description": "Id of the iTwin where the iModel resides." }, "iModelId": { "type": "string", "description": "Id of the iModel to query for status of changesets." }, "startChangesetId": { "type": "string", "description": "Id of the changeset to start from. This changeset must occur before end changeset." }, "endChangesetId": { "type": "string", "description": "Id of the changeset to end at. This changeset must occur after start changeset." } }, "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?