generateEmbedUrlForRegisteredUser method

Future<GenerateEmbedUrlForRegisteredUserResponse> generateEmbedUrlForRegisteredUser({
  1. required String awsAccountId,
  2. required RegisteredUserEmbeddingExperienceConfiguration experienceConfiguration,
  3. required String userArn,
  4. List<String>? allowedDomains,
  5. int? sessionLifetimeInMinutes,
})

Generates an embed URL that you can use to embed an Amazon Quick experience in your website. This action can be used for any type of user registered in an Amazon Quick account. Before you use this action, make sure that you have configured the relevant Amazon Quick resource and permissions.

The following rules apply to the generated URL:

  • It contains a temporary bearer token. It is valid for 5 minutes after it is generated. Once redeemed within this period, it cannot be re-used again.
  • The URL validity period should not be confused with the actual session lifetime that can be customized using the SessionLifetimeInMinutes parameter.

    The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours.

  • You are charged only when the URL is used or there is interaction with Amazon Quick.
For more information, see Embedded Analytics in the Amazon Quick User Guide.

For more information about the high-level steps for embedding and for an interactive demo of the ways you can customize embedding, visit the Amazon Quick Developer Portal.

May throw AccessDeniedException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw QuickSightUserNotFoundException. May throw ResourceNotFoundException. May throw SessionLifetimeInMinutesInvalidException. May throw ThrottlingException. May throw UnsupportedPricingPlanException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The ID for the Amazon Web Services account that contains the dashboard that you're embedding.

Parameter experienceConfiguration : The experience that you want to embed. For registered users, you can embed Quick dashboards, Amazon Quick Sight visuals, the Amazon Quick Sight Q search bar, the Amazon Quick Sight Generative Q&A experience, or the entire Amazon Quick Sight console.

Parameter userArn : The Amazon Resource Name for the registered user.

Parameter allowedDomains : The domains that you want to add to the allow list for access to the generated URL that is then embedded. This optional parameter overrides the static domains that are configured in the Manage Quick Sight menu in the Amazon Quick Sight console. Instead, it allows only the domains that you include in this parameter. You can list up to three domains or subdomains in each API call.

To include all subdomains under a specific domain to the allow list, use . For example, https://.sapp.amazon.com includes all subdomains under https://sapp.amazon.com.

Parameter sessionLifetimeInMinutes : How many minutes the session is valid. The session lifetime must be in [15-600] minutes range.

Implementation

Future<GenerateEmbedUrlForRegisteredUserResponse>
    generateEmbedUrlForRegisteredUser({
  required String awsAccountId,
  required RegisteredUserEmbeddingExperienceConfiguration
      experienceConfiguration,
  required String userArn,
  List<String>? allowedDomains,
  int? sessionLifetimeInMinutes,
}) async {
  _s.validateNumRange(
    'sessionLifetimeInMinutes',
    sessionLifetimeInMinutes,
    15,
    600,
  );
  final $payload = <String, dynamic>{
    'ExperienceConfiguration': experienceConfiguration,
    'UserArn': userArn,
    if (allowedDomains != null) 'AllowedDomains': allowedDomains,
    if (sessionLifetimeInMinutes != null)
      'SessionLifetimeInMinutes': sessionLifetimeInMinutes,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/embed-url/registered-user',
    exceptionFnMap: _exceptionFns,
  );
  return GenerateEmbedUrlForRegisteredUserResponse.fromJson(response);
}