Table of contents
Library
Download API definition:
POST https://dev-api.bentley.com/library/upload

Uploads a design file to create a digital component.

Notes

This endpoint is to create a component from design file. Supported file extensions are '.rfa', '.dgn' and '.cel'. This is a long running activity that runs in background after the endpoint is called and creates a component by extracting information from the design file, e.g., category, application, manufacturer and other metadata found in the design file. Response object has links to upload the design file or type catalog file, if specified. Client must upload type catalog file before uploading design file. Once files are uploaded, component creation activity can be tracked using job endpoint returned in the 'Location' header. Once job succeeds, component can be fetched using 'component' property provided under _links in job endpoint response.

Referenced Entities

A component can have referenced entities, e.g catalogs. These values should be valid Ids of existing entities.

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 or have Upload permission assigned at the organization level.

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.

Rate limits

All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.

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.

Request body

UploadComponent (create)

Name
Type
Required?
Description
fileName
String
No

Name of the design file to be uploaded.

componentName
String
No

Display name of the component.

description
String
No

Description of the component.

application
Object, null
No

Associated application Id, must be a string value of valid GUID of existing application.

category
Object, null
No

Associated category Id, must be a string value of valid GUID of existing category.

manufacturer
Object, null
No

Associated manufacturer Id, must be a string value of valid GUID of existing manufacturer.

searchTags
String[]
No

Hashtags assigned to component.

catalogs
String[]
No

Referenced catalogs of the component.

isTypeCatalog
Boolean
No

Specifies if component is a TypeCatalog.

Example

json
{
    "fileName": "door.rfa",
    "componentName": "Wooden Door",
    "description": "A wooden door",
    "searchTags": [
        "door",
        "woodendoor"
    ],
    "catalogs": [],
    "category": null,
    "application": null,
    "manufacturer": null,
    "isTypeCatalog": false
}

Response 202 Accepted

Accepted

json
{
    "uploadComponent": {
        "fileName": "door.rfa",
        "componentName": "Wooden Door",
        "description": "A wooden door",
        "sessionId": "fu791e2d-e3e2-4c38-b5d9-0573a01e5934",
        "searchTags": [
            "door",
            "woodendoor"
        ],
        "isTypeCatalog": true,
        "_links": {
            "catalogs": [{
                    "href": "https://api.bentley.com/library/catalogs/c7391e2d-e3e2-4c38-b5d9-0573a01e590d"
                },
                {
                    "href": "https://api.bentley.com/library/catalogs/ht391e2d-e3e2-4c38-b5d9-0573a01e597j"
                }
            ],
            "typeCatalogUploadUrl": {
                "href": "https://componentscenprodeussa01.blob.core.windows.net/private-temporary-type-catalog-files/2517765788748761853_4496211b-322e-4f3a-80f4-cc97cdad2e2a.typecatalog?sv=2018-03-28&sr=b&sig=zGVjkn9X90nAqJawdgx0EK02zKzdNso7zlCxQuYDvM4%3D&se=2021-07-08T06%3A25%3A25Z&sp=rcw"
            },
            "designFileUploadUrl": {
                "href": "https://componentscenprodeussa01.blob.core.windows.net/private-temporary-design-files/2517765788748761853_4496211b-322e-4f3a-80f4-cc97cdad2e2a.design?sv=2018-03-28&sr=b&sig=pPQUu7E5yo9ZOyHnhLtqoDbfh5qaQB1mmplgjOoQB%2BM%3D&se=2021-07-08T06%3A25%3A25Z&sp=rcw"
            }
        }
    }
}

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 403 Forbidden

This response indicates that user does not have required permissions to upload component.

json
{
    "error": {
        "code": "InsufficientPermissions",
        "message": "The user has insufficient permissions for the requested operation."
    }
}

Response 422 Unprocessable Entity

Invalid request to upload component.

json
{
    "error": {
        "code": "InvalidUploadComponentRequest",
        "message": "Cannot upload component.",
        "details": [{
                "code": "MissingRequiredProperty",
                "message": "Required property is missing.",
                "target": "fileName"
            },
            {
                "code": "InvalidValue",
                "message": "'sample.txt' is not supported format. File extension must be 'rfa', 'dgn' or 'cel'.",
                "target": "fileName"
            },
            {
                "code": "InvalidValue",
                "message": "Provided Referenced entities not valid."
            }
        ]
    }
}

Response 429 Too many requests

This response indicates that the user has sent too many requests in a given amount of time.

json
{
    "error": {
        "code": "TooManyRequests",
        "message": "More requests were received than the subscription rate-limit allows."
    }
}

Response headers

Name
Description
retry-after

The number of requests exceeds the rate-limit for the client subscription.

UploadComponent (create)

UploadComponent represents information required to create a digital component from a design file and any associated entities to that component.

Name
Type
Description
fileName
String

Name of the design file to be uploaded.

componentName
String

Display name of the component.

description
String

Description of the component.

application
Object, null

Associated application Id, must be a string value of valid GUID of existing application.

category
Object, null

Associated category Id, must be a string value of valid GUID of existing category.

manufacturer
Object, null

Associated manufacturer Id, must be a string value of valid GUID of existing manufacturer.

searchTags
String[]

Hashtags assigned to component.

catalogs
String[]

Referenced catalogs of the component.

isTypeCatalog
Boolean

Specifies if component is a TypeCatalog.

UploadComponent (response)

Upload component response containing uploadComponent.

Name
Type
Description
uploadComponent

Full representation of the uploadComponent.

UploadComponent

UploadComponent represents information required to create a digital component and urls to upload design/type catalog files.

Name
Type
Description
fileName
String

Name of the design file to be uploaded.

componentName
String

Display name of the component.

description
String

Description of the component.

sessionId
String

Unique identifier of upload component session.

searchTags
String[]

Hashtags assigned to component.

isTypeCatalog
Boolean

Specifies if component is a TypeCatalog.

_links

Contains the hyperlinks to the related data of the UploadComponent.

Upload Component Links

Hyperlinks to related data which complements this entity.

Name
Type
Description
catalogs

Links of referenced catalogs.

application

Link to associated application of the component.

category

Link to associated category of the component.

manufacturer

Link to associated manufacturer of the component.

typeCatalogUploadUrl

Link to upload type catalog file of the component.

designFileUploadUrl

Link to upload design file of the component.

Link

Name
Type
Description
href
String

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?