CreateViewCommand

Creates a new view with the possible status of SAVED or PUBLISHED.

The views will have a unique name for each connect instance.

It performs basic content validation if the status is SAVED or full content validation if the status is set to PUBLISHED. An error is returned if validation fails. It associates either the $SAVED qualifier or both of the $SAVED and $LATEST qualifiers with the provided view content based on the status. The view is idempotent if ClientToken is provided.

Example Syntax

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

import { ConnectClient, CreateViewCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, CreateViewCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // CreateViewRequest
  InstanceId: "STRING_VALUE", // required
  ClientToken: "STRING_VALUE",
  Status: "PUBLISHED" || "SAVED", // required
  Content: { // ViewInputContent
    Template: "STRING_VALUE",
    Actions: [ // ViewActions
      "STRING_VALUE",
    ],
  },
  Description: "STRING_VALUE",
  Name: "STRING_VALUE", // required
  Tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateViewCommand(input);
const response = await client.send(command);
// { // CreateViewResponse
//   View: { // View
//     Id: "STRING_VALUE",
//     Arn: "STRING_VALUE",
//     Name: "STRING_VALUE",
//     Status: "PUBLISHED" || "SAVED",
//     Type: "CUSTOMER_MANAGED" || "AWS_MANAGED",
//     Description: "STRING_VALUE",
//     Version: Number("int"),
//     VersionDescription: "STRING_VALUE",
//     Content: { // ViewContent
//       InputSchema: "STRING_VALUE",
//       Template: "STRING_VALUE",
//       Actions: [ // ViewActions
//         "STRING_VALUE",
//       ],
//     },
//     Tags: { // TagMap
//       "<keys>": "STRING_VALUE",
//     },
//     CreatedTime: new Date("TIMESTAMP"),
//     LastModifiedTime: new Date("TIMESTAMP"),
//     ViewContentSha256: "STRING_VALUE",
//   },
// };

CreateViewCommand Input

See CreateViewCommandInput for more details

Parameter
Type
Description
Content
Required
ViewInputContent | undefined

View content containing all content necessary to render a view except for runtime input data.

The total uncompressed content has a maximum file size of 400kB.

InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

Name
Required
string | undefined

The name of the view.

Status
Required
ViewStatus | undefined

Indicates the view status as either SAVED or PUBLISHED. The PUBLISHED status will initiate validation on the content.

ClientToken
string | undefined

A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.

Description
string | undefined

The description of the view.

Tags
Record<string, string> | undefined

The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

CreateViewCommand Output

See CreateViewCommandOutput for details

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

A view resource object. Contains metadata and content necessary to render the view.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient permissions to perform this action.

DuplicateResourceException
client

A resource with the specified name already exists.

InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

InvalidRequestException
client

The request is not valid.

ResourceInUseException
client

That resource is already in use. Please try another.

ResourceNotFoundException
client

The specified resource was not found.

ServiceQuotaExceededException
client

The service quota has been exceeded.

TooManyRequestsException
client

Displayed when rate-related API limits are exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.