StartDashboardSnapshotJobCommand

Starts an asynchronous job that generates a snapshot of a dashboard's output. You can request one or several of the following format configurations in each API call.

  • 1 Paginated PDF

  • 1 Excel workbook that includes up to 5 table or pivot table visuals

  • 5 CSVs from table or pivot table visuals

The status of a submitted job can be polled with the DescribeDashboardSnapshotJob API. When you call the DescribeDashboardSnapshotJob API, check the JobStatus field in the response. Once the job reaches a COMPLETED or FAILED status, use the DescribeDashboardSnapshotJobResult API to obtain the URLs for the generated files. If the job fails, the DescribeDashboardSnapshotJobResult API returns detailed information about the error that occurred.

StartDashboardSnapshotJob API throttling

Amazon QuickSight utilizes API throttling to create a more consistent user experience within a time span for customers when they call the StartDashboardSnapshotJob. By default, 12 jobs can run simlutaneously in one Amazon Web Services account and users can submit up 10 API requests per second before an account is throttled. If an overwhelming number of API requests are made by the same user in a short period of time, Amazon QuickSight throttles the API calls to maintin an optimal experience and reliability for all Amazon QuickSight users.

Common throttling scenarios

The following list provides information about the most commin throttling scenarios that can occur.

  • A large number of SnapshotExport API jobs are running simultaneously on an Amazon Web Services account. When a new StartDashboardSnapshotJob is created and there are already 12 jobs with the RUNNING status, the new job request fails and returns a LimitExceededException error. Wait for a current job to comlpete before you resubmit the new job.

  • A large number of API requests are submitted on an Amazon Web Services account. When a user makes more than 10 API calls to the Amazon QuickSight API in one second, a ThrottlingException is returned.

If your use case requires a higher throttling limit, contact your account admin or Amazon Web ServicesSupport  to explore options to tailor a more optimal expereince for your account.

Best practices to handle throttling

If your use case projects high levels of API traffic, try to reduce the degree of frequency and parallelism of API calls as much as you can to avoid throttling. You can also perform a timing test to calculate an estimate for the total processing time of your projected load that stays within the throttling limits of the Amazon QuickSight APIs. For example, if your projected traffic is 100 snapshot jobs before 12:00 PM per day, start 12 jobs in parallel and measure the amount of time it takes to proccess all 12 jobs. Once you obtain the result, multiply the duration by 9, for example (12 minutes * 9 = 108 minutes). Use the new result to determine the latest time at which the jobs need to be started to meet your target deadline.

The time that it takes to process a job can be impacted by the following factors:

  • The dataset type (Direct Query or SPICE).

  • The size of the dataset.

  • The complexity of the calculated fields that are used in the dashboard.

  • The number of visuals that are on a sheet.

  • The types of visuals that are on the sheet.

  • The number of formats and snapshots that are requested in the job configuration.

  • The size of the generated snapshots.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QuickSightClient, StartDashboardSnapshotJobCommand } from "@aws-sdk/client-quicksight"; // ES Modules import
// const { QuickSightClient, StartDashboardSnapshotJobCommand } = require("@aws-sdk/client-quicksight"); // CommonJS import
const client = new QuickSightClient(config);
const input = { // StartDashboardSnapshotJobRequest
  AwsAccountId: "STRING_VALUE", // required
  DashboardId: "STRING_VALUE", // required
  SnapshotJobId: "STRING_VALUE", // required
  UserConfiguration: { // SnapshotUserConfiguration
    AnonymousUsers: [ // SnapshotAnonymousUserList
      { // SnapshotAnonymousUser
        RowLevelPermissionTags: [ // SessionTagList
          { // SessionTag
            Key: "STRING_VALUE", // required
            Value: "STRING_VALUE", // required
          },
        ],
      },
    ],
  },
  SnapshotConfiguration: { // SnapshotConfiguration
    FileGroups: [ // SnapshotFileGroupList // required
      { // SnapshotFileGroup
        Files: [ // SnapshotFileList
          { // SnapshotFile
            SheetSelections: [ // SnapshotFileSheetSelectionList // required
              { // SnapshotFileSheetSelection
                SheetId: "STRING_VALUE", // required
                SelectionScope: "ALL_VISUALS" || "SELECTED_VISUALS", // required
                VisualIds: [ // SnapshotFileSheetSelectionVisualIdList
                  "STRING_VALUE",
                ],
              },
            ],
            FormatType: "CSV" || "PDF" || "EXCEL", // required
          },
        ],
      },
    ],
    DestinationConfiguration: { // SnapshotDestinationConfiguration
      S3Destinations: [ // SnapshotS3DestinationConfigurationList
        { // SnapshotS3DestinationConfiguration
          BucketConfiguration: { // S3BucketConfiguration
            BucketName: "STRING_VALUE", // required
            BucketPrefix: "STRING_VALUE", // required
            BucketRegion: "STRING_VALUE", // required
          },
        },
      ],
    },
    Parameters: { // Parameters
      StringParameters: [ // StringParameterList
        { // StringParameter
          Name: "STRING_VALUE", // required
          Values: [ // SensitiveStringList // required
            "STRING_VALUE",
          ],
        },
      ],
      IntegerParameters: [ // IntegerParameterList
        { // IntegerParameter
          Name: "STRING_VALUE", // required
          Values: [ // SensitiveLongList // required
            Number("long"),
          ],
        },
      ],
      DecimalParameters: [ // DecimalParameterList
        { // DecimalParameter
          Name: "STRING_VALUE", // required
          Values: [ // SensitiveDoubleList // required
            Number("double"),
          ],
        },
      ],
      DateTimeParameters: [ // DateTimeParameterList
        { // DateTimeParameter
          Name: "STRING_VALUE", // required
          Values: [ // SensitiveTimestampList // required
            new Date("TIMESTAMP"),
          ],
        },
      ],
    },
  },
};
const command = new StartDashboardSnapshotJobCommand(input);
const response = await client.send(command);
// { // StartDashboardSnapshotJobResponse
//   Arn: "STRING_VALUE",
//   SnapshotJobId: "STRING_VALUE",
//   RequestId: "STRING_VALUE",
//   Status: Number("int"),
// };

StartDashboardSnapshotJobCommand Input

Parameter
Type
Description
AwsAccountId
Required
string | undefined

The ID of the Amazon Web Services account that the dashboard snapshot job is executed in.

DashboardId
Required
string | undefined

The ID of the dashboard that you want to start a snapshot job for.

SnapshotConfiguration
Required
SnapshotConfiguration | undefined

A structure that describes the configuration of the dashboard snapshot.

SnapshotJobId
Required
string | undefined

An ID for the dashboard snapshot job. This ID is unique to the dashboard while the job is running. This ID can be used to poll the status of a job with a DescribeDashboardSnapshotJob while the job runs. You can reuse this ID for another job 24 hours after the current job is completed.

UserConfiguration
Required
SnapshotUserConfiguration | undefined

A structure that contains information about the anonymous users that the generated snapshot is for. This API will not return information about registered Amazon QuickSight.

StartDashboardSnapshotJobCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

The Amazon Resource Name (ARN) for the dashboard snapshot job.

RequestId
string | undefined

The Amazon Web Services request ID for this operation.

SnapshotJobId
string | undefined

The ID of the job. The job ID is set when you start a new job with a StartDashboardSnapshotJob API call.

Status
number | undefined

The HTTP status of the request

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon QuickSight service, that your policies have the correct permissions, and that you are using the correct credentials.

InternalFailureException
server

An internal failure occurred.

InvalidParameterValueException
client

One or more parameters has a value that isn't valid.

LimitExceededException
client

A limit is exceeded.

ResourceExistsException
client

The resource specified already exists.

ResourceNotFoundException
client

One or more resources can't be found.

ThrottlingException
client

Access is throttled.

UnsupportedPricingPlanException
client

This error indicates that you are calling an embedding operation in Amazon QuickSight without the required pricing plan on your Amazon Web Services account. Before you can use embedding for anonymous users, a QuickSight administrator needs to add capacity pricing to Amazon QuickSight. You can do this on the Manage Amazon QuickSight page.

After capacity pricing is added, you can use the GetDashboardEmbedUrl  API operation with the --identity-type ANONYMOUS option.

UnsupportedUserEditionException
client

This error indicates that you are calling an operation on an Amazon QuickSight subscription where the edition doesn't include support for that operation. Amazon Amazon QuickSight currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.

QuickSightServiceException
Base exception class for all service exceptions from QuickSight service.