Creates a new Repository URI.
A repository is a Uri link to iTwin data managed by another service. The links for most classes are autogenerated but some can only be added manually using this POST endpoint.
The following Classes/SubClasses can be added using this POST endpoint.
- 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
The user must have the itwins_modify
permission in order to add a repository URI to the iTwin.
An Organization Administrator can modify iTwins owned by their Organization. This includes adding a repository URI.
Organization Administrators are power users for all iTwins owned by their organization. They will be able to create, modify or delete any iTwin. Example: john.doe@example.com is an Organization Administrator that works for Example Industries. John will be able to create iTwins and those iTwins will belong to Example Industries. John and any other Organization Administrator for Example Industries will be able to update or delete the iTwin. Any user (an employee of Example Industries, or an external participant) can be invited to collaborate on the iTwin.
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
The iTwin Id
Request headers
OAuth access token with itwin-platform
scope
Setting to application/vnd.bentley.itwin-platform.v1+json
is recommended.
Request body
iTwin-repository-create
The uri to the custom repository.
Example
{ "class": "GeographicInformationSystem", "subClass": "WebMapTileService", "uri": "https://developer.bentley.com" }
Response 201 Created
Repository successfully created.
{ "repository": { "id": "e2ecdff7-2802-48bf-9bfa-d418c740c8cd", "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.
{ "error": { "code": "HeaderNotFound", "message": "Header Authorization was not found in the request. Access denied." } }
Response 403 Forbidden
The user is not authorized to create an iTwin Repository.
{ "error": { "code": "InsufficientPermissions", "message": "The user has insufficient permissions for the requested operation." } }
Response 404 Not Found
This response indicates that the specified repository was not found.
{ "error": { "code": "iTwinNotFound", "message": "Requested iTwin is not available." } }
Response 409 Conflict
iTwin with the same name already exists.
{ "error": { "code": "iTwinRepositoryExists", "message": "The specified iTwin Repository already exists." } }
Response 422 Unprocessable Entity
Invalid request to create a iTwin. Review the 'Field Values' section near the top of this page.
{ "error": { "code": "InvalidiTwinsRequest", "message": "Cannot add iTwin Repository.", "details": [{ "code": "InvalidValue", "message": "Class value is incorrect.", "target": "class" }, { "code": "InvalidValue", "message": "SubClass value is incorrect.", "target": "subClass" }, { "code": "MissingRequiredProperty", "message": "A required property is missing or empty.", "target": "class" }, { "code": "MissingRequiredProperty", "message": "A required property is missing or empty.", "target": "uri" } ] } }
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.
iTwin-repository-response
{ "type": "object", "properties": { "repository": { "$ref": "#/components/schemas/iTwin-repository" } }, "required": [ "repository" ], "additionalProperties": false }
iTwin Repository Class
The class of your iTwin repository.
{ "type": "string", "title": "iTwin Repository Class", "description": "The class of your iTwin repository.", "enum": [ "RealityData", "iModels", "Storage", "Forms", "Issues", "Construction", "GeographicInformationSystem", "CesiumCuratedContent", "SensorData", "Subsurface" ] }
iTwin Repository SubClass
The subclass of your iTwin repository.
{ "type": "string", "title": "iTwin Repository SubClass", "description": "The subclass of your iTwin repository.", "enum": [ "WebMapService", "WebMapTileService", "MapServer", "Performance", "EvoWorkspace" ] }
iTwin-repository
The iTwin repository id.
The uri to the repository.
{ "type": "object", "properties": { "id": { "type": "string", "description": "The iTwin repository id." }, "class": { "$ref": "#/components/schemas/iTwinRepositoryClass" }, "subClass": { "$ref": "#/components/schemas/iTwinRepositorySubClass" }, "uri": { "type": "string", "description": "The uri to the repository." } }, "additionalProperties": false }
iTwin-repository-create
{ "type": "object", "properties": { "class": { "$ref": "#/components/schemas/iTwinRepositoryClass" }, "subClass": { "$ref": "#/components/schemas/iTwinRepositorySubClass" }, "uri": { "type": "string", "description": "The uri to the custom repository." } }, "additionalProperties": false, "example": { "class": "GeographicInformationSystem", "subClass": "WebMapTileService", "url": "https://developer.bentley.com" }, "required": [ "class", "uri" ] }
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?