CreateTemplate -

CreateTemplate

Creates a template from an existing QuickSight analysis or template. You can use the resulting template to create a dashboard.

A template is an entity in QuickSight that encapsulates the metadata required to create an analysis and that you can use to create s dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with the analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.

Request Syntax

POST /accounts/AwsAccountId/templates/TemplateId HTTP/1.1 Content-type: application/json { "Name": "string", "Permissions": [ { "Actions": [ "string" ], "Principal": "string" } ], "SourceEntity": { "SourceAnalysis": { "Arn": "string", "DataSetReferences": [ { "DataSetArn": "string", "DataSetPlaceholder": "string" } ] }, "SourceTemplate": { "Arn": "string" } }, "Tags": [ { "Key": "string", "Value": "string" } ], "VersionDescription": "string" }

URI Request Parameters

The request uses the following URI parameters.

AwsAccountId

The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.

Length Constraints: Fixed length of 12.

Pattern: ^[0-9]{12}$

Required: Yes

TemplateId

An ID for the template that you want to create. This template is unique per AWS Region in each AWS account.

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [\w\-]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

SourceEntity

The entity that you are using as a source when you create the template. In SourceEntity, you specify the type of object you're using as source: SourceTemplate for a template or SourceAnalysis for an analysis. Both of these require an Amazon Resource Name (ARN). For SourceTemplate, specify the ARN of the source template. For SourceAnalysis, specify the ARN of the source analysis. The SourceTemplate ARN can contain any AWS Account and any QuickSight-supported AWS Region.

Use the DataSetReferences entity within SourceTemplate or SourceAnalysis to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.

Type: TemplateSourceEntity object

Required: Yes

Name

A display name for the template.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [\u0020-\u00FF]+

Required: No

Permissions

A list of resource permissions to be set on the template.

Type: Array of ResourcePermission objects

Array Members: Minimum number of 1 item. Maximum number of 64 items.

Required: No

Tags

Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.

Type: Array of Tag objects

Array Members: Minimum number of 1 item. Maximum number of 200 items.

Required: No

VersionDescription

A description of the current template version being created. This API operation creates the first version of the template. Every time UpdateTemplate is called, a new version is created. Each version of the template maintains a description of the version in the VersionDescription field.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Required: No

Response Syntax

HTTP/1.1 Status Content-type: application/json { "Arn": "string", "CreationStatus": "string", "RequestId": "string", "TemplateId": "string", "VersionArn": "string" }

Response Elements

If the action is successful, the service sends back the following HTTP response.

Status

The HTTP status of the request.

The following data is returned in JSON format by the service.

Arn

The ARN for the template.

Type: String

CreationStatus

The template creation status.

Type: String

Valid Values: CREATION_IN_PROGRESS | CREATION_SUCCESSFUL | CREATION_FAILED | UPDATE_IN_PROGRESS | UPDATE_SUCCESSFUL | UPDATE_FAILED

RequestId

The AWS request ID for this operation.

Type: String

TemplateId

The ID of the template.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: [\w\-]+

VersionArn

The ARN for the template, including the version information of the first version.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

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 access keys.

HTTP Status Code: 401

ConflictException

Updating or deleting a resource can cause an inconsistent state.

HTTP Status Code: 409

InternalFailureException

An internal failure occurred.

HTTP Status Code: 500

InvalidParameterValueException

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

HTTP Status Code: 400

LimitExceededException

A limit is exceeded.

HTTP Status Code: 409

ResourceExistsException

The resource specified already exists.

HTTP Status Code: 409

ResourceNotFoundException

One or more resources can't be found.

HTTP Status Code: 404

ThrottlingException

Access is throttled.

HTTP Status Code: 429

UnsupportedUserEditionException

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 QuickSight currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.

HTTP Status Code: 403

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: