Table of contents
iTwins
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
GET https://api.bentley.com/itwins/{iTwinId}/repositories/{repositoryId}/resources/{resourceId}

This endpoint will return the specified resource in the specified repository.

For example, if the repository Id is imodels then it will return the id and displayName of the specified iModel. It will only return the iModel information if the user has permission to view it. For some resources, it will also return capabilities.graphics.uri that can be used to locate graphics for the resource.

Only the repositories with these classes support the resources endpoint:

  • iModels
  • RealityData
  • GeospatialFeatures
  • CesiumCuratedContent
  • PdfPlansets
  • GeographicInformationSystem

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

The calling user must be a member of the specified iTwin. Use the Access Control API to manage an iTwin's members.

Request parameters

Name
Required?
Description
iTwinId
Yes

The iTwin Id

repositoryId
Yes

The repository Id

resourceId
Yes

The resource Id

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
{
    "resource": {
        "id": "96188",
        "class": "CesiumCuratedContent",
        "type": "3DTILES",
        "displayName": "Cesium OSM Buildings",
        "capabilities": {
            "graphics": {
                "uri": "https://api.bentley.com/itwins/a6615cc6-823a-4587-8da8-478672523b7f/repositories/cesiumcuratedcontent/resources/96188/graphics"
            }
        }
    }
}

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

json
{
    "error": {
        "code": "iTwinRepositoryResourceNotFound",
        "message": "Requested iTwin Repository Resource 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.

Resource

Name
Type
Description
id
String

The resource Id. For example, for the iModels repository, this would be an iModel Id. For the CesiumCuratedContent repository, this would be the content Id. Each repository defines it's own id format. Treat it as a string and do not assume it will be a GUID or integer.

class

The resource class. This value is copied from the repository.

subClass

The resource class. This value is copied from the repository and may be empty.

type
String

The type of resource as specified by the repository. This is not a fixed list. The values are specific to each respository and not every repository will specify a resource type. In that case, the type property will not be included in the response.

displayName
String

The resource name that can be displayed to the user.

capabilities.graphics

GraphicsCapability

Name
Type
Description
uri
String

A uri containing the location of the graphics content. This value can be cached but be aware that it might change over time. Some might contain a SAS key that expires after some time.

ResourceClass

The resource class.

Name
Type
Description
iModels
String
RealityData
String
CesiumCuratedContent
String
GeospatialFeatures
String
PdfPlansets
String
GeographicInformationSystem
String

ResourceSubClass

The resource subclass.

Name
Type
Description
WebMapService
String
WebMapTileService
String
ArcGIS
String
UrlTemplate
String

ResourceResponse

Name
Type
Description
resource

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?