Table of contents
iTwins
Download API definition:
GET https://api.bentley.com/itwins/{iTwinId}/repositories[?class][&subClass]

Gets the details of the specified repository.

A repository is a Uri link to iTwin data managed by another service.

For example, if an iTwin has Forms data then you can get the Uri for that data by using this api and specifying iTwinId = 547d397a-9921-4e4f-a7a2-c47fc19219b0 and Class = Forms. It will return the following.

{
   "repositories": [
   {
      "id": "547d397a-9921-4e4f-a7a2-c47fc19219b0",
      "class": "Forms",
      "subClass": null,
      "uri": "https://api.bentley.com/forms?projectId=547d397a-9921-4e4f-a7a2-c47fc19219b0"
   }]
}

If no Class is specified then all repositories containing data for the iTwin will be returned. The Uri is automatically generated by calling each service to determine if its repository contains data for the specified iTwin. For example, if there are no iModels for the specified iTwin then the iModel Repository Uri will not be returned.

The following Classes/SubClasses are supported. Classes in italics are auto generated. The others can be added manually using the POST endpoint.

  • iModels
  • RealityData
  • Storage
  • Forms
  • Issues
  • SensorData
  • GeographicInformationSystem
    • WebMapService
    • WebMapTileService
    • MapServer
  • Construction
    • Performance
  • Subsurface
    • EvoWorkspace

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.

Authorization

User must be an Organization Administrator for the Organization that owns the specified iTwin Repository or be an iTwin team member.

An Organization Administrator must have at least one of the following roles assigned in User Management: Account Administrator, Co-Administrator, or CONNECT Services Administrator. For more information about User Management please visit our Bentley Communities Licensing, Cloud, and Web Services wiki page.

Request parameters

Name
Required?
Description
iTwinId
Yes

The iTwin Id

class
No

Specify a particular class that you wish to query on.

subClass
No

Specify a particular subClass that you wish to query on (NOTE: Only the 'GeographicInformationSystem' class can have a subClass).

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.

Response 200 OK

OK

json
{
    "repositories": [{
            "id": "5ebf5b78-a4e4-4bfe-8b1d-838f2c419259",
            "class": "Construction",
            "subClass": "Performance",
            "uri": "https://developer.bentley.com"
        },
        {
            "id": "6cbfd529-bb6d-4438-9209-09501f214502",
            "class": "GeographicInformationSystem",
            "subClass": "WebMapTileService",
            "uri": "https://developer.bentley.com"
        }
    ]
}

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 repository was not found.

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

Response 422 Unprocessable Entity

Invalid request to get Repositories

json
{
    "error": {
        "code": "InvalidiTwinsRequest",
        "message": "Cannot query iTwin Repositories.",
        "details": [{
                "code": "InvalidValue",
                "message": "A valid iTwin Repository Class was not specified in the query.",
                "target": "class"
            },
            {
                "code": "InvalidValue",
                "message": "A valid iTwin Repository SubClass was not specified in the query.",
                "target": "subClass"
            },
            {
                "code": "InvalidValue",
                "message": "iTwinId contains an invalid value.",
                "target": "iTwinId"
            }
        ]
    }
}

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.

iTwin-repositories-response

Name
Type
Description
repositories

iTwin Repository Class

The class of your iTwin repository.

Name
Type
Description
RealityData
String
iModels
String
Storage
String
Forms
String
Issues
String
Construction
String
GeographicInformationSystem
String
CesiumCuratedContent
String

iTwin Repository SubClass

The subclass of your iTwin repository.

Name
Type
Description
WebMapService
String
WebMapTileService
String
MapServer
String
Performance
String

iTwin-repository

Name
Type
Description
id
String

The iTwin repository id.

uri
String

The uri to the repository.

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.