Discussions

Save Configuration

Save the current configuration

Introduction

For more information on the new Save Configuration feature, please check out our platform release notes.

Save Configuration

This API will allow you to save an item's current configuration. With the optional parameters you will also be able to tie additional information to the configuration. All you need to do is call the saveConfiguration method

player.saveConfiguration()

This will return two things:

  • shortId immediately, which you can present as a link or QR code. Keep in mind saving the sceneGraphState can take a few seconds depending on the size of the scene but will not affect the shortId return time. You can find your sceneGraphState settings in the platform settings, information here.
  • A promise of the result from the configurations API endpoint.

Optional Parameters

{
    // If unspecified, defaults to org settings
    saveSceneGraphState: true, 
    customerId: '9e7d9691-3001-47dd-9645-ba981eb29e53',
    metadata: {hello: 'world'},
    productVersion: 'v1',
    attachments: {}
}

If you would like to associate a Snapshot to your saved configuration, you just need to send it with the attachments parameter:

attachments: {
    "key": file 
}
ParameterDefinition
saveSceneGraphStateBoolean - override the org's default settings to save or ignore the sceneGraphState.
customerIdString/ID - ID of the customer
metadataObject - any additional metadata you would like to provide to the configuration.
productVersionString - version of the product.
attachmentsObject - This field can be used to define mappings to fetch files, if multiple files are attached to the the request

Example return:

{
  shortId: 'abc123',
  res: Promise<{
    attachments: {},
    createdAt: "2022-09-15T14:59:31.103Z",
    customerId: '9e7d9691-3001-47dd-9645-ba981eb29e53',
    id: "70899fbe-3b19-4ef4-8a69-b2dbb7ebea20",
    identifier: null,
    metadata: {hello: 'world'},,
    orgId: "3eb15a1d-ca0b-47d5-9fc0-4c0bb16533d2",
    productId: "bb9ef9bc-393c-4a71-a7f1-2d7b88c4444b",
    productVersion: "v1",
    sceneGraphState: "68fb5017-ee7b-42fb-9d83-bb1ba8398a9b",
    scope: null,
    shortId: "bMeZhLyMd",
    thumbnail: null,
    variant: {Color: {r: 0, g: 1, b: 0.5}}
  }>