Begin the import of an asset that the user has already uploaded via our upload endpoint.
The response field of the Operation will contain a StartAssetImportResponse
once the import has successfully completed.
Checking for completion can be done by checking the Operation.done field. Operation name is of the form: operations/poly/assetimport/{$assetImportId}
HTTP request
POST https://poly.googleapis.com/v1/assets:startImport
The URL uses Google API HTTP annotation syntax.
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{ "importFormat": { object( |
Fields | |
---|---|
importFormat |
The files to import. These files should already have been uploaded to our upload endpoint. |
displayName |
The suggested title of the asset. The user can change it later during the publish flow. |
description |
The suggested description of the asset. The user can change it later during the publish flow. |
metadata |
Arbitrary application-defined metadata that should be stored with the asset. This data will be returned when querying for the asset (provided the caller is signed in with the user that owns the asset). This string is limited to 1K chars (when encoded in UTF8). |
remixInfo |
The remix info for the asset. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/vrassetdata.readwrite
For more information, see the OAuth 2.0 Overview.
ImportFormat
Representation of an asset to import. Refers to the specific representation of an asset and contains all information needed to retrieve and describe the representation. Currently, only WaveFront .obj formats are supported for import.
This message presumes that all necessary files have already been uploaded to the server and thus have been assigned element IDs. Therefore, references to files are made using their element IDs.
JSON representation | |
---|---|
{ "root": string, "resources": [ string ], "formatType": string } |
Fields | |
---|---|
root |
Element ID of the root file in the hierarchy. This will always be populated. For the "OBJ" format, this is the element ID of the .obj file itself. |
resources[] |
A list of element IDs representing additional files (dependencies) of the root element. May include, but is not limited to, materials, textures, and shader programs. |
formatType |
A short string that identifies the format type of this representation. Currently, the only supported format on import is "OBJ". |