This endpoint will return the list of resources in the specified repository.
For example, if the repository Id is imodels
then it will return the id and displayName of all iModels in the iTwin. It will only return iModels that the user has permission to view. It will also return capabilities.graphics.uri
that can be used to locate graphics that can be displayed for the resource.
We do not recommend hardcoding the uri for the resources endpoint in your client code. Instead, use the capabilities.resources.uri
property that is returned from the Get iTwin Repositories API.
Only these repositories support the resources endpoint:
- iModels
- RealityData
- GeospatialFeatures
- CesiumCuratedContent
- PdfPlansets
Pagination
The resources endpoint supports pagination but some repositories may use a continuation token to paginate the results
while others may use a top and skip approach. You do not need to worry about this detail if you use the _links.next
property to get the next page of results. The _links.next
property will only be present if there are more results.
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
The iTwin Id
The repository Id
The $top query option requests the number of items in the queried collection to be included in the result. The default is 100. The max is 1000. This sets the page size and should not be confused with the X-Max-Return header.
The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.
A case-insensitive search string. If you specify abc then the api will return any resource with abc anywhere in the displayName.
Request headers
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v1+json
is recommended.
Response 200 OK
OK
{ "resources": [{ "id": "1", "class": "CesiumCuratedContent", "type": "TERRAIN", "displayName": "Cesium World Terrain", "capabilities": { "graphics": { "uri": "https://api.bentley.com/itwins/a6615cc6-823a-4587-8da8-478672523b7f/repositories/cesiumcuratedcontent/resources/1/graphics" } } }, { "id": "3954", "class": "CesiumCuratedContent", "type": "IMAGERY", "displayName": "Sentinel-2", "capabilities": { "graphics": { "uri": "https://api.bentley.com/itwins/a6615cc6-823a-4587-8da8-478672523b7f/repositories/cesiumcuratedcontent/resources/3954/graphics" } } }, { "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" } } } ], "_links": { "self": { "href": "https://api.bentley.com/itwins/a6615cc6-823a-4587-8da8-478672523b7f/repositories/cesiumcuratedcontent/resources/resources" }, "next": { "href": "https://api.bentley.com/itwins/a6615cc6-823a-4587-8da8-478672523b7f/repositories/cesiumcuratedcontent/resources/resources?$skip=10&$top=10" } } }
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 repository was not found.
{ "error": { "code": "iTwinNotFound", "message": "Requested iTwin is not available." } }
Response 422 Unprocessable Entity
Invalid request to get Repositories
{ "error": { "code": "InvalidiTwinsRequest", "message": "Cannot query iTwin Repositories.", "details": [{ "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.
{ "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.
links
URLs for the current request or getting the next page of results.
{ "title": "links", "description": "URLs for the current request or getting the next page of results.", "type": "object", "properties": { "self": { "description": "URL for the current request.", "$ref": "#/components/schemas/link" }, "next": { "description": "URL for getting the next page of results. This will only exist if there is a next page.", "$ref": "#/components/schemas/link" } }, "additionalProperties": false }
link
Hyperlink container.
Hyperlink container.
{ "type": "object", "description": "Hyperlink container.", "properties": { "href": { "type": "string", "description": "Hyperlink container." } }, "additionalProperties": false }
Resource
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.
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.
The resource name that can be displayed to the user.
{ "type": "object", "properties": { "id": { "type": "string", "description": "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": { "$ref": "#/components/schemas/ResourceClass" }, "type": { "type": "string", "description": "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": { "type": "string", "description": "The resource name that can be displayed to the user." }, "capabilities": { "type": "object", "required": [ "graphics" ], "properties": { "graphics": { "$ref": "#/components/schemas/GraphicsCapability" } }, "additionalProperties": false } }, "additionalProperties": false }
GraphicsCapability
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.
{ "type": "object", "properties": { "uri": { "type": "string", "description": "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." } }, "additionalProperties": false }
ResourceClass
The resource class.
{ "type": "string", "enum": [ "iModels", "RealityData", "CesiumCuratedContent", "GeospatialFeatures", "PdfPlansets" ], "description": "The resource class." }
ResourceArrayResponse
{ "type": "object", "properties": { "resources": { "type": "array", "description": "List of resources for the repository.", "items": { "$ref": "#/components/schemas/Resource" } }, "_links": { "description": "Contains the hyperlinks to the current and next pages of results.", "$ref": "#/components/schemas/links-paging-noprev" } }, "required": [ "resources" ], "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?