Skip to content
Get started

List Snapshots

client.assets.listSnapshots(stringassetID, AssetListSnapshotsParams { pageSize, paginationToken } query?, RequestOptionsoptions?): SnapshotsCursor<AssetListSnapshotsResponse { authorId, hash, rawData, takenAt } >
GET/assets/{assetId}/snapshots

List snapshots of a canvas type asset

ParametersExpand Collapse
assetID: string
query: AssetListSnapshotsParams { pageSize, paginationToken }
pageSize?: number

The number of items to return in the response. The default value is 10, maximum value is 100, minimum value is 10

minimum10
maximum100
paginationToken?: string

A token you received in a previous request to query the next page of items

ReturnsExpand Collapse
AssetListSnapshotsResponse { authorId, hash, rawData, takenAt }
authorId: string
hash: string
rawData: string
takenAt: number

List Snapshots

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const assetListSnapshotsResponse of client.assets.listSnapshots('assetId')) {
  console.log(assetListSnapshotsResponse.authorId);
}
{
  "snapshots": [
    {
      "authorId": "authorId",
      "hash": "hash",
      "rawData": "rawData",
      "takenAt": 0
    }
  ],
  "nextPaginationToken": "nextPaginationToken"
}
Returns Examples
{
  "snapshots": [
    {
      "authorId": "authorId",
      "hash": "hash",
      "rawData": "rawData",
      "takenAt": 0
    }
  ],
  "nextPaginationToken": "nextPaginationToken"
}