### periodToDateStDevP Example Calculation Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/periodToDateStDevP-function Provides an example of using the periodToDateStDevP function to calculate the week-to-date minimum fare amount per payment type. The example specifies the measure, dateTime, period (WEEK), and a specific endDate. It highlights the week's start day convention. ```sql periodToDateStDevP(fare_amount, pickUpDatetime, WEEK, parseDate("06-30-2021", "MM-dd-yyyy")) ``` -------------------------------- ### Example `describe-topic` API Response JSON Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs This is an example JSON output from the `describe-topic` API call. It details the topic's ID, ARN, name, and associated datasets, including their configurations. This structure serves as a template for creating a new topic. ```json { "Status": 200, "TopicId": "TopicExample", "Arn": "string", "Topic": [ { "Name": "{}", "DataSets": [ { "DataSetArn": "{}", "DataSetName": "{}", "DataSetDescription": "{}", "DataAggregation": "{}", "Filters": [], "Columns": [], "CalculatedFields": [], "NamedEntities": [] } ] } ], "RequestId": "requestId" } ``` -------------------------------- ### Create Topic Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs Creates a new topic in the target QuickSight account using a JSON skeleton file derived from the source topic's description. ```APIDOC ## CREATE TOPIC ### Description Creates a new topic in the target QuickSight account using a JSON skeleton file. ### Method POST ### Endpoint /topics ### Parameters #### Query Parameters - **aws-account-id** (string) - Required - The AWS account ID of the target account. #### Request Body - **cli-input-json** (file) - Required - Path to the JSON file containing the topic configuration. ### Request Example ```bash aws quicksight create-topic --aws-account-id AWSACCOUNTID \ --cli-input-json file://./create-topic-cli-input.json ``` ### Response #### Success Response (200) - **Status** (integer) - The HTTP status code. - **TopicId** (string) - The ID of the newly created topic. - **Arn** (string) - The ARN of the newly created topic. - **RequestId** (string) - The request ID. #### Response Example ```json { "Status": 200, "TopicId": "NewTopicId", "Arn": "arn:aws:quicksight:us-east-1:123456789012:topic/NewTopicId", "RequestId": "some-request-id" } ``` ``` -------------------------------- ### Calculate countOver for {County} partitioned by City and State Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/countOver-function This example shows how to use the countOver function to get the count of '{County}' partitioned over 'City' and 'State'. Similar to the previous example, it uses '{County}' as the measure and 'City', 'State' for partitioning. ```QuickSight countOver( {County}, [City, State] ) ``` -------------------------------- ### Describe QuickSight Topic Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-examples Retrieves detailed information about how a specific QuickSight topic was configured. ```APIDOC ## GET /quicksight/describe-topic ### Description Retrieves detailed information about how a specific QuickSight topic was configured. ### Method GET ### Endpoint /quicksight/describe-topic #### Query Parameters - **aws-account-id** (string) - Required - The AWS account ID associated with your QuickSight account. - **topic-id** (string) - Required - The unique identifier for the topic to describe. ### Request Example (CLI) ```bash aws quicksight describe-topic \ --aws-account-id AWSACCOUNTID \ --topic-id TOPICID ``` ### Response #### Success Response (200) - **Topic** (object) - The detailed configuration of the topic. - **TopicArn** (string) - The ARN of the topic. - **TopicId** (string) - The ID of the topic. - **Name** (string) - The name of the topic. - **Description** (string) - A description of the topic. - **Definition** (object) - The definition of the topic. - **Status** (string) - The status of the topic. - **CreatedTimestamp** (timestamp) - The timestamp when the topic was created. - **LastUpdatedTimestamp** (timestamp) - The timestamp when the topic was last updated. #### Response Example ```json { "Topic": { "TopicArn": "arn:aws:quicksight:us-east-1:123456789012:topic/TOPICID", "TopicId": "TOPICID", "Name": "Sales Trends", "Description": "Analysis of quarterly sales performance.", "Definition": {}, "Status": "ACTIVE", "CreatedTimestamp": "2023-10-27T10:00:00Z", "LastUpdatedTimestamp": "2023-10-27T10:30:00Z" } } ``` ``` -------------------------------- ### Describe Folder Resolved Permissions Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/folders-scaled This example shows how to get the effective permissions of a folder, considering permissions inherited from parent folders, using the AWS CLI. ```APIDOC ## GET /folders/{folderId}/resolved-permissions ### Description Retrieves the effective permissions for a folder, including any permissions inherited from parent folders. ### Method GET ### Endpoint `/folders/{folderId}/resolved-permissions` ### Parameters #### Path Parameters * `folderId` (string) - Required - The ID of the folder whose resolved permissions are to be described. #### Query Parameters * `--aws-account-id` (string) - Required - The AWS account ID. * `--region` (string) - Required - The AWS region. * `--namespace` (string) - Required - The namespace of the folder. ### Request Example ```bash aws quicksight describe-folder-resolved-permissions \ --aws-account-id "AWSACCOUNTID" \ --region "us-east-1" \ --folder-id "new-york-users" \ --namespace "default" ``` ### Response #### Success Response (200 OK) - **`Permissions`** (array of objects) - A list of permission objects. * **`Principal`** (string) - The ARN of the principal. * **`Actions`** (array of strings) - The QuickSight actions allowed for the principal. - **`RequestId`** (string) - The ID of the request. - **`Status`** (integer) - The HTTP status code of the response. #### Response Example (Response structure not explicitly provided in source, but would typically list effective principals and their granted actions.) ``` -------------------------------- ### SQL Query Examples for Join Demonstration Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/joining-data These SQL queries demonstrate example data from 'safety-rating' and 'widget' tables, used to illustrate different join types in Amazon QuickSight. They show the structure and content of the tables involved in join operations. ```SQL SELECT * FROM safety-rating ``` ```SQL rating_id safety_rating 1 A+ 2 A 3 A- 4 B+ 5 B ``` ```SQL SELECT * FROM WIDGET ``` ```SQL widget_id widget safety_rating_id 1 WidgetA 3 2 WidgetB 1 3 WidgetC 1 4 WidgetD 2 5 WidgetE 6 WidgetF 5 7 WidgetG ``` -------------------------------- ### Locate Substring After Specific Character Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/locate-function This example demonstrates finding the first occurrence of a substring starting after a specified character position. The 'locate' function accepts the main string, the substring, and an optional starting index. It returns the index of the first match found after the specified position. ```javascript locate('1 and 2 and 3 and 4', 'and', 4) ``` -------------------------------- ### Describe Quick Sight Topic Configuration using AWS CLI Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-examples Fetches detailed information about the configuration of a specific Amazon Quick Sight topic. This command helps in understanding how a topic was set up and its current settings. ```bash aws quicksight describe-topic \ --aws-account-id AWSACCOUNTID \ --topic-id TOPICID ``` -------------------------------- ### Filter employees based on employment start and end dates Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/isWorkDay-function This example demonstrates how to filter employees based on their employment dates. It uses the isWorkDay function to determine if the employment start date and end date fall on a workday or a weekend. This is useful for analyzing employee tenure and payroll. ```text is_start_date_work_day = isWorkDay(employment_start_date) is_end_date_work_day = isWorkDay(employment_end_date) ``` -------------------------------- ### Get Dashboard Embed URL - .NET/C# Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/embedded-dashboards-for-authenticated-users-get-step-2 This .NET/C# example illustrates how to obtain a QuickSight dashboard embed URL using the AWS SDK for .NET. ```APIDOC ## GET /getDashboardEmbedUrl (.NET/C# SDK) ### Description Demonstrates using the AWS SDK for .NET to call the `GetDashboardEmbedUrlAsync` method. This retrieves a URL suitable for embedding a QuickSight dashboard. ### Method POST (Implicitly, as this is an SDK call to an AWS API) ### Endpoint (Not directly applicable, as this is an SDK call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (Parameters passed to the SDK method) - **AwsAccountId** (string) - Required - Your AWS account ID. - **DashboardId** (string) - Required - The ID of the dashboard to embed. - **IdentityType** (EmbeddingIdentityType) - Required - The type of identity. Use `EmbeddingIdentityType.IAM` for IAM identity. - **ResetDisabled** (bool) - Optional - Set to `true` to disable the reset button. - **SessionLifetimeInMinutes** (long) - Optional - The duration in minutes for the embed URL validity. - **UndoRedoDisabled** (bool) - Optional - Set to `true` to disable undo/redo buttons. - **StatePersistenceEnabled** (bool) - Optional - Set to `true` to enable state persistence. ### Request Example ```csharp var client = new AmazonQuickSightClient( AccessKey, SecretAccessKey, sessionToken, Amazon.RegionEndpoint.USEast1); try { Console.WriteLine( client.GetDashboardEmbedUrlAsync(new GetDashboardEmbedUrlRequest { AwsAccountId = ā€œ111122223333ā€, DashboardId = "1c1fe111-e2d2-3b30-44ef-a0e111111cde", IdentityType = EmbeddingIdentityType.IAM, ResetDisabled = true, SessionLifetimeInMinutes = 100, UndoRedoDisabled = false, StatePersistenceEnabled = true }).Result.EmbedUrl ); } catch (Exception ex) { Console.WriteLine(ex.Message); } ``` ### Response #### Success Response (200) - **EmbedUrl** (string) - The URL for the embedded dashboard. #### Response Example (Output is typically printed to the console) ``` https://dashboards.example.com/embed/620bef10822743fab329fb3751187d2d... ``` ``` -------------------------------- ### List Topics Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs Lists all topics in your QuickSight account to help identify the topic you want to migrate. ```APIDOC ## LIST TOPICS ### Description Lists all topics in your QuickSight account. ### Method GET ### Endpoint /topics ### Parameters #### Query Parameters - **aws-account-id** (string) - Required - The AWS account ID. ### Request Example ```bash aws quicksight list-topics --aws-account-id AWSACCOUNTID ``` ### Response #### Success Response (200) - **Status** (integer) - The HTTP status code. - **TopicId** (string) - The ID of the topic. - **Arn** (string) - The Amazon Resource Name (ARN) of the topic. - **RequestId** (string) - The request ID. #### Response Example ```json { "Status": 200, "TopicId": "TopicExample", "Arn": "string", "RequestId": "requestId" } ``` ``` -------------------------------- ### Java - Get Session Embed URL Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/embedded-analytics-full-console-for-authenticated-users-get-step-2 Example Java code using the AWS SDK to retrieve an embeddable URL for an Amazon QuickSight console session. ```APIDOC ## Java - Get Session Embed URL ### Description Example Java code using the AWS SDK to retrieve an embeddable URL for an Amazon QuickSight console session. ### Method Java SDK Call ### Endpoint `GetSessionEmbedUrl` operation of the Amazon QuickSight client. ### Parameters #### Request Body (Implicit via SDK Object) - **awsAccountId** (String) - Your AWS Account ID. - **entryPoint** (String) - The entry point URL for the console session. - **sessionLifetimeInMinutes** (Integer) - The duration for which the session URL will be valid, in minutes. - **userArn** (String) - The ARN of the user for whom the session URL is generated. ### Request Example ```java import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.regions.Regions; import com.amazonaws.services.quicksight.AmazonQuickSight; import com.amazonaws.services.quicksight.AmazonQuickSightClientBuilder; import com.amazonaws.services.quicksight.model.GetSessionEmbedUrlRequest; import com.amazonaws.services.quicksight.model.GetSessionEmbedUrlResult; /** * Class to call QuickSight AWS SDK to get url for session embedding. */ public class GetSessionEmbedUrlQSAuth { private final AmazonQuickSight quickSightClient; public GetSessionEmbedUrlQSAuth() { this.quickSightClient = AmazonQuickSightClientBuilder .standard() .withRegion(Regions.US_EAST_1.getName()) .withCredentials(new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { // provide actual IAM access key and secret key here return new BasicAWSCredentials("access-key", "secret-key"); } }) .build(); } public String getEmbedUrl(String awsAccountId, String entryPoint, Integer sessionLifetime, String userArn) { GetSessionEmbedUrlRequest request = new GetSessionEmbedUrlRequest() .withAwsAccountId(awsAccountId) .withEntryPoint(entryPoint) .withSessionLifetimeInMinutes(sessionLifetime) .withUserArn(userArn); GetSessionEmbedUrlResult result = quickSightClient.getSessionEmbedUrl(request); return result.getEmbedUrl(); } public static void main(String[] args) { GetSessionEmbedUrlQSAuth embedUrlGenerator = new GetSessionEmbedUrlQSAuth(); String embedUrl = embedUrlGenerator.getEmbedUrl( "111122223333", "the-url-for-the-console-session", 600, "arn:aws:quicksight:us-east-1:111122223333:user/default/embedding_quicksight_dashboard_role/embeddingsession" ); System.out.println("Embed URL: " + embedUrl); } } ``` ### Response #### Success Response (200) Returns the embeddable URL for the QuickSight console session. #### Response Example ```json { "EmbedUrl": "https://us-east-1.quicksight.aws.amazon.com/sn/dashboards/embed/EXAMPLE123?AWSAccessKeyId=EXAMPLEKEY&Signature=EXAMPLEHASH&X-Amz-Security-Token=EXAMPLETOKEN", "RequestId": "example-request-id", "Status": 200 } ``` ``` -------------------------------- ### Set up IAM Permissions Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/monitoring-quicksuite-chat-feedback-cloudwatch Provides example IAM policies required to grant Amazon Quick Suite access to CloudWatch Logs and KMS for encryption. ```APIDOC ## Set up IAM Permissions To set up CloudWatch Logs for Amazon Quick Suite, use the following IAM policy examples to grant the necessary permissions. ### IAM Policy for Quicksight Log Delivery ```json { "Version": "2012-10-17", "Statement": [ { "Sid": "QuicksightLogDeliveryPermissions", "Effect": "Allow", "Action": "quicksight:AllowVendedLogDeliveryForResource", "Resource": "arn:aws:quicksight:region:account-id:account/account-id" } ] } ``` ### KMS Key Policy for Log Delivery Service You must also allow the `delivery.logs.amazonaws.com` service principal in your customer managed AWS KMS key policy. ```json { "Effect": "Allow", "Principal": { "Service": "delivery.logs.amazonaws.com" }, "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:SourceArn": "arn:partition:logs:region:account-id:*" } } } ``` ``` -------------------------------- ### startsWith with NOT Operator Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/startsWith-function This example shows how to use the NOT operator in conjunction with startsWith to determine if an expression does NOT start with a specified substring. It returns true if 'state_nm' does not begin with 'New'. ```sql NOT(startsWith(state_nm, "New")) ``` -------------------------------- ### Okta SAML Federation URL Example Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/tutorial-okta-quicksight This XML snippet shows an example of the SAML SingleSignOnService URL found in the metadata.xml file provided by Okta. This URL is crucial for configuring IAM federation in Amazon Quick Suite and for creating deep links. ```xml ``` -------------------------------- ### Describe Topic Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs Retrieves the configuration of a specific topic, which is needed to create a skeleton file for migration. ```APIDOC ## DESCRIBE TOPIC ### Description Retrieves the configuration details of a specific topic. ### Method GET ### Endpoint /topics/{topicId} ### Parameters #### Path Parameters - **topicId** (string) - Required - The ID of the topic to describe. #### Query Parameters - **aws-account-id** (string) - Required - The AWS account ID. ### Request Example ```bash aws quicksight describe-topic \ --aws-account-id AWSACCOUNTID \ --topic-id TOPICID ``` ### Response #### Success Response (200) - **Status** (integer) - The HTTP status code. - **TopicId** (string) - The ID of the topic. - **Arn** (string) - The Amazon Resource Name (ARN) of the topic. - **Topic** (array) - An array containing the topic's configuration details. - **Name** (string) - The name of the topic. - **DataSets** (array) - An array of dataset configurations. - **DataSetArn** (string) - The ARN of the dataset. - **DataSetName** (string) - The name of the dataset. - **DataSetDescription** (string) - The description of the dataset. - **DataAggregation** (string) - The data aggregation settings. - **Filters** (array) - A list of filters applied to the dataset. - **Columns** (array) - A list of columns in the dataset. - **CalculatedFields** (array) - A list of calculated fields. - **NamedEntities** (array) - A list of named entities. - **RequestId** (string) - The request ID. #### Response Example ```json { "Status": 200, "TopicId": "TopicExample", "Arn": "string", "Topic": [ { "Name": "{} ", "DataSets": [ { "DataSetArn": "{}", "DataSetName": "{}", "DataSetDescription": "{}", "DataAggregation": "{}", "Filters": [], "Columns": [], "CalculatedFields": [], "NamedEntities": [] } ] } ], "RequestId": "requestId" } ``` ``` -------------------------------- ### GetSessionEmbedUrl - Python Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/embedded-analytics-full-console-for-authenticated-users-get-step-2 This Python example shows how to generate an embedded URL for a QuickSight session using the Boto3 SDK. It outlines the necessary client setup and function parameters. ```APIDOC ## GET /embedding/session ### Description Generates an embeddable URL for a QuickSight session using Python and Boto3. This endpoint is used to embed QuickSight content within applications. ### Method GET ### Endpoint /embedding/session ### Parameters #### Path Parameters None #### Query Parameters - **accountId** (string) - Required - Your AWS Account ID. - **userArn** (string) - Required - The ARN of the registered QuickSight user. - **entryPoint** (string) - Optional - The entry point for the session (e.g., "/start"). - **sessionLifetimeInMinutes** (integer) - Optional - The desired lifetime of the session in minutes. ### Request Example ```python import boto3 qs = boto3.client('quicksight', region_name='us-east-1') def get_session_embed_url(account_id, user_arn): response = qs.get_session_embed_url( AwsAccountId=account_id, EntryPoint="/start", UserArn=user_arn ) return response.get('EmbedUrl') # Example usage: # account_id = 'YOUR_AWS_ACCOUNT_ID' # user_arn = 'REGISTERED_USER_ARN' # embed_url = get_session_embed_url(account_id, user_arn) # print(embed_url) ``` ### Response #### Success Response (200) - **embedUrl** (string) - The embeddable URL for the QuickSight session. #### Response Example ```json { "embedUrl": "https://us-east-1.quicksight.aws.amazon.com/sn/start?dashboardId=..." } ``` ``` -------------------------------- ### Describe User API Response Example (JSON) Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/troubleshoot-webidentity-federation An example JSON response from the `DescribeUser` API operation, illustrating the structure and content of user details, including external login provider information. ```json { "Status": 200, "User": { "Arn": "arn:aws:quicksight:us-east-1:111222333:user-default-IdentityQuickSightRole-user", "UserName": "IdentityQuickSightRole-user", "Email": "user@amazon.com", "Role": "ADMIN", "IdentityType": "IAM", "Active": true, "PrincipalId": "federated-iam-AROAAAAAAAAAAAAAA:user", "ExternalLoginFederationProviderType": "COGNITO", "ExternalLoginFederationProviderUrl": "cognito-identity.amazonaws.com", "ExternalLoginId": "us-east-1:123abc-1234-123a-b123-12345678a" }, "RequestId": "12345678-1234-1234-abc1-a1b1234567" } ``` -------------------------------- ### periodToDateSum Function Example in AWS Quick Suite Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/periodToDateSum-function Demonstrates how to use the periodToDateSum function to calculate the sum of 'fare_amount' per payment for a specific week. The example specifies the 'pickUpDateTime' as the date dimension and 'WEEK' as the period. It also shows how to parse a specific date string for the 'endDate'. The week is assumed to start on Sundays. ```AWS Quick Suite periodToDateSum(fare_amount, pickUpDateTime, WEEK, parseDate("06-30-2021", "MM-dd-yyyy")) ``` -------------------------------- ### Create Topic using AWS CLI with JSON Input Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/topic-cli-walkthroughs This command creates a new topic in QuickSight using a JSON file as input. The `create-topic-cli-input.json` file should contain the skeleton of the topic's configuration, adapted from the `describe-topic` output. Remember to update the AWS account ID and dataset IDs within this file. ```bash aws quicksight create-topic --aws-account-id AWSACCOUNTID \ --cli-input-json file://./create-topic-cli-input.json ``` -------------------------------- ### Get Dashboard Embed URL - Node.js Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/embedded-dashboards-for-authenticated-users-get-step-2 This Node.js example shows how to use the AWS SDK to retrieve an embed URL for a QuickSight dashboard. It includes common parameters for embedding. ```APIDOC ## GET /getDashboardEmbedUrl (Node.js SDK) ### Description Uses the AWS SDK for JavaScript (Node.js) to call the `GetDashboardEmbedUrl` API operation. This retrieves a URL that can be used to embed a QuickSight dashboard into a web application. ### Method POST (Implicitly, as this is an SDK call to an AWS API) ### Endpoint (Not directly applicable, as this is an SDK call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (Parameters passed to the SDK method) - **AwsAccountId** (string) - Required - Your AWS account ID. - **DashboardId** (string) - Required - The ID of the dashboard to embed. - **IdentityType** (string) - Required - The type of identity to use for embedding. Typically 'IAM'. - **ResetDisabled** (boolean) - Optional - Set to `true` to disable the reset button in the embedded dashboard. - **SessionLifetimeInMinutes** (number) - Optional - The duration in minutes for which the embed URL is valid. - **UndoRedoDisabled** (boolean) - Optional - Set to `true` to disable the undo/redo buttons in the embedded dashboard. - **StatePersistenceEnabled** (boolean) - Optional - Set to `true` to enable state persistence for the embedded session. ### Request Example ```javascript const AWS = require('aws-sdk'); const https = require('https'); var quicksight = new AWS.Service({ apiConfig: require('./quicksight-2018-04-01.min.json'), region: 'us-east-1', }); quicksight.getDashboardEmbedUrl({ 'AwsAccountId': '111122223333', 'DashboardId': '1c1fe111-e2d2-3b30-44ef-a0e111111cde', 'IdentityType': 'IAM', 'ResetDisabled': true, 'SessionLifetimeInMinutes': 100, 'UndoRedoDisabled': false, 'StatePersistenceEnabled': true }, function(err, data) { console.log('Errors: '); console.log(err); console.log('Response: '); console.log(data); }); ``` ### Response #### Success Response (200) - **EmbedUrl** (string) - The URL to embed the dashboard. - **RequestId** (string) - The unique ID of the request. #### Response Example ```json { "Status": 200, "EmbedUrl": "https://dashboards.example.com/embed/620bef10822743fab329fb3751187d2d…", "RequestId": "7bee030e-f191-45c4-97fe-d9faf0e03713" } ``` ``` -------------------------------- ### Python3 SDK - List Users and Groups Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/quicksight-sdks This example demonstrates creating, deleting, and listing groups, followed by listing users in an Amazon QuickSight account using the Python3 SDK with botocore. ```APIDOC ## Group and User Operations ### Description This set of operations allows for managing groups (create, delete, list) and listing users within an Amazon QuickSight account using the Python3 SDK. ### Method POST (for create/delete), GET (for list) ### Endpoint Not directly exposed as REST endpoints, but available via botocore client methods. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (For create_group and delete_group) - **AwsAccountId** (string) - Required - The AWS account ID. - **Namespace** (string) - Required - The namespace, typically 'default'. - **GroupName** (string) - Required - The name of the group. ### Request Example ```python import botocore.session default_namespace = 'default' account_id = 'relevant_AWS_Account' session = botocore.session.get_session() client = session.create_client("quicksight", region_name='us-east-1') print('Creating three groups: ') client.create_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup1') client.create_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup2') client.create_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup3') print('Retrieving the groups and listing them: ') response = client.list_groups(AwsAccountId = account_id, Namespace=default_namespace) for group in response['GroupList']: print(group) print('Deleting our groups: ') client.delete_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup1') client.delete_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup2') client.delete_group(AwsAccountId = account_id, Namespace=default_namespace, GroupName='MyGroup3') response = client.list_users(AwsAccountId = account_id, Namespace=default_namespace) for user in response['UserList']: print(user) ``` ### Response #### Success Response (200) - **GroupList** (List) - A list of group dictionaries. - **UserList** (List) - A list of user dictionaries. #### Response Example ```json { "GroupList": [ { "GroupName": "MyGroup1", "Arn": "arn:aws:quicksight:us-east-1:111122223333:group/default/MyGroup1", "PrincipalId": "some-uuid-1", "CreationTime": "2023-01-01T10:00:00Z", "LastUpdatedTime": "2023-01-01T10:00:00Z" } ], "UserList": [ { "Arn": "arn:aws:quicksight:us-east-1:111122223333:user/default/UserName", "UserName": "UserName", "PrincipalId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "Email": "user@example.com", "UserRole": "READER", "Activeibilidade": true, "CreateTime": "2023-01-01T00:00:00.000Z", "LastUpdateTime": "2023-01-01T00:00:00.000Z" } ] } ``` ``` -------------------------------- ### Java SDK - Get Dashboard Embed URL Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/embedded-analytics-dashboards-with-anonymous-users-get-step-2 This section provides a Java code example for obtaining an embeddable dashboard URL using the AWS SDK for Java. ```APIDOC ## POST /quickSight/get-dashboard-embed-url (Java SDK) ### Description This Java code snippet demonstrates how to use the AWS SDK for Java to get an embeddable URL for a QuickSight dashboard, configured for anonymous access. ### Method POST (conceptually, via SDK call) ### Endpoint `com.amazonaws.services.quicksight.AmazonQuickSight.getDashboardEmbedUrl` ### Parameters #### Request Body (Implicit via SDK object) - **accountId** (String) - Required - YOUR AWS ACCOUNT ID. - **dashboardId** (String) - Required - YOUR DASHBOARD ID TO EMBED. - **addtionalDashboardIds** (String) - Optional - ADDITIONAL DASHBOARD-1 ADDITIONAL DASHBOARD-2. - **resetDisabled** (boolean) - Optional - OPTIONAL PARAMETER TO ENABLE DISABLE RESET BUTTON IN EMBEDDED DASHBAORD. - **undoRedoDisabled** (boolean) - Optional - OPTIONAL PARAMETER TO ENABLE DISABLE UNDO REDO BUTTONS IN EMBEDDED DASHBAORD. - **awsAccountId** (String) - Required - The AWS account ID. - **namespace** (String) - Required - The namespace for embedding (e.g., 'default'). - **identityType** (String) - Required - Must be 'ANONYMOUS'. ### Request Example ```java import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.regions.Regions; import com.amazonaws.services.quicksight.AmazonQuickSight; import com.amazonaws.services.quicksight.AmazonQuickSightClientBuilder; import com.amazonaws.services.quicksight.model.GetDashboardEmbedUrlRequest; import com.amazonaws.services.quicksight.model.GetDashboardEmbedUrlResult; /** * Class to call QuickSight AWS SDK to get url for dashboard embedding. */ public class GetQuicksightEmbedUrlNoAuth { private static String ANONYMOUS = "ANONYMOUS"; private final AmazonQuickSight quickSightClient; public GetQuicksightEmbedUrlNoAuth() { this.quickSightClient = AmazonQuickSightClientBuilder .standard() .withRegion(Regions.US_EAST_1.getName()) .withCredentials(new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { // provide actual IAM access key and secret key here return new BasicAWSCredentials("access-key", "secret-key"); } @Override public void refresh() {} } ) .build(); } public String getQuicksightEmbedUrl( final String accountId, // YOUR AWS ACCOUNT ID final String dashboardId, // YOUR DASHBOARD ID TO EMBED final String addtionalDashboardIds, // ADDITIONAL DASHBOARD-1 ADDITIONAL DASHBOARD-2 final boolean resetDisabled, // OPTIONAL PARAMETER TO ENABLE DISABLE RESET BUTTON IN EMBEDDED DASHBAORD final boolean undoRedoDisabled // OPTIONAL PARAMETER TO ENABLE DISABLE UNDO REDO BUTTONS IN EMBEDDED DASHBAORD ) throws Exception { GetDashboardEmbedUrlRequest getDashboardEmbedUrlRequest = new GetDashboardEmbedUrlRequest() .withDashboardId(dashboardId) .withAdditionalDashboardIds(addtionalDashboardIds) .withAwsAccountId(accountId) .withNamespace("default") // Anonymous embedding requires specifying a valid namespace for which you want the embedding url .withIdentityType(ANONYMOUS) .withResetDisabled(resetDisabled) .withUndoRedoDisabled(undoRedoDisabled); GetDashboardEmbedUrlResult result = quickSightClient.getDashboardEmbedUrl(getDashboardEmbedUrlRequest); return result.getEmbedUrl(); } } ``` ### Response #### Success Response (200) - **EmbedUrl** (string) - The generated embeddable URL for the dashboard. ``` -------------------------------- ### Substring Function Example Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/substring-function Demonstrates the usage of the substring function to extract a specific part of a string. It shows how to specify the starting character position (1-based index) and the number of characters to include. ```text substring('Fantasy and Science Fiction',13,7) ``` -------------------------------- ### Customer Support Response Prompt Example Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/editing-flows An example prompt designed for a customer support agent persona. It instructs the AI to be professional, empathetic, and solution-oriented, providing specific resolution steps. It uses a placeholder '@{input_text}' for customer inquiries. ```prompt You are a helpful customer support agent for a software company. Write a response to the customer's inquiry below. Be professional, empathetic, and solution-oriented. Include specific steps the customer can follow to resolve their issue. Customer inquiry: @{input_text} ``` -------------------------------- ### startsWith in Conditional Statements Source: https://docs.aws.amazon.com/quicksuite/latest/userguide/startsWith-function The startsWith function can be integrated into conditional aggregation functions like sumIf. This example sums the 'Sales' field only for records where the 'state_nm' field starts with 'New' (case-sensitive). ```sql sumIf(Sales,startsWith(state_nm, "New")) ```