Scenes
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
put https://dev-api.bentley.com/scenes/{sceneId}/objects/{objectId}/image?iTwinId

Uploads an image for the specified scene object, replacing any existing image.

A small, thumbnail image will be automatically generated based on the uploaded image. For convenience, the link to this thumbnail is also returned in the image property on the scene object.

Maximum supported size is 5 megabytes. Maximum supported aspect ratio is 5:1. You must specify the Content-Type header as either image/png or image/jpeg.

Images are currently only supported for the object kind: View3d

Request parameters

Name
Required?
Description
sceneId
Yes

Scene Id

objectId
Yes

Object Id

iTwinId
Yes

Primary iTwin Id associated with the scene

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.

Content-Type
Yes

Indicates request body content type. Must be image/png or image/jpeg.

Response 200 OK

Link to fetch the uploaded image.

json
{
    "image": {
        "href": "https://example.net/scene-images/[...]?sv=[...]&sig=[...]"
    }
}

Response 400 Bad Request

Unprocessable Entity

json
{
    "error": {
        "code": "InvalidScenesRequest",
        "message": "Cannot update image.",
        "target": "image",
        "details": [{
            "code": "InvalidRequestBody",
            "message": "The width or height dimensions of the image cannot be greater than 5 times the size of each other."
        }]
    }
}

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

Forbidden

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

Response 404 Not Found

Not Found

json
{
    "error": {
        "code": "SceneObjectNotFound",
        "message": "Requested sceneObject is not available.",
        "target": "sceneObject"
    }
}

Response 413 Request Entity Too Large

Payload Too Large

json
{
    "error": {
        "code": "RequestTooLarge",
        "message": "Request body is greater than the max size of 5MiB."
    }
}

Response 415 Unsupported Media Type

Unsupported Media Type

json
{
    "error": {
        "code": "UnsupportedMediaType",
        "message": "Media Type is not supported."
    }
}

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.

Link

Name
Type
Description
href
String

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

target
String, null

The target of the error.

message
String

A human-readable representation of the error.

image-binary

The binary image file

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.

ImageResponse

Name
Type
Description
image
All of: Link

The URL of the image

Was this page helpful?