Uploads an image for the specified iTwin. Maximum supported size is 5 megabytes.
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 iTwin.
Upload the image by adding a binary stream to the request body. You must specify the Content-Type header as either image/png or image/jpeg.
C# Example:
var stream = File.OpenRead("c:/test.jpg");
var streamContent = new StreamContent(stream);
streamContent.Headers.ContentType = new MediaTypeHeaderValue ("image/jpeg");
var response = await httpClient.PutAsync($"{iTwinId}/image", streamContent);
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 on the iTwin in order to add an image to the iTwin.
An Organization Administrator can modify any iTwins owned by their Organization. This allows Organization Administrators to upload an iTwin image.
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.