Skip to content

generate_embed_url_for_registered_user async

generate_embed_url_for_registered_user(
    aws_account_id: AwsAccountId,
    user_arn: Arn,
    experience_configuration: RegisteredUserEmbeddingExperienceConfiguration,
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    session_lifetime_in_minutes: Optional[SessionLifetimeInMinutes] = None,
    allowed_domains: Optional[StringList] = None,
) -> GenerateEmbedUrlForRegisteredUserResponse

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.

Parameters:

  • aws_account_id (AwsAccountId) –

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

  • session_lifetime_in_minutes (Optional[SessionLifetimeInMinutes], default: None ) –

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

  • user_arn (Arn) –

    The Amazon Resource Name for the registered user.

  • experience_configuration (RegisteredUserEmbeddingExperienceConfiguration) –

    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.

  • allowed_domains (Optional[StringList], default: None ) –

    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.

Raises:

  • 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 Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.

  • InternalFailureException –

    An internal failure occurred.

  • InvalidParameterValueException –

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

  • QuickSightUserNotFoundException –

    The user with the provided name isn't found. This error can happen in any operation that requires finding a user based on a provided user name, such as DeleteUser, DescribeUser, and so on.

  • ResourceNotFoundException –

    One or more resources can't be found.

  • SessionLifetimeInMinutesInvalidException –

    The number of minutes specified for the lifetime of a session isn't valid. The session lifetime must be 15-600 minutes.

  • ThrottlingException –

    Access is throttled.

  • UnsupportedPricingPlanException –

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

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

  • UnsupportedUserEditionException –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_quicksight/_services/async_quick_sight.py
async def generate_embed_url_for_registered_user(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    user_arn: "capo_quicksight.types.arn.Arn",
    experience_configuration: "capo_quicksight.types.registered_user_embedding_experience_configuration.RegisteredUserEmbeddingExperienceConfiguration",
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    session_lifetime_in_minutes: Optional[
        "capo_quicksight.types.session_lifetime_in_minutes.SessionLifetimeInMinutes"
    ] = None,
    allowed_domains: Optional[
        "capo_quicksight.types.string_list.StringList"
    ] = None,
) -> "capo_quicksight.types.generate_embed_url_for_registered_user_response.GenerateEmbedUrlForRegisteredUserResponse":
    """<p>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.</p> <p>The following rules apply to the generated URL:</p> <ul> <li> <p>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.</p> </li> <li> <p>The URL validity period should not be confused with the actual session lifetime that can be customized using the <code> <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GenerateEmbedUrlForRegisteredUser.html#QS-GenerateEmbedUrlForRegisteredUser-request-SessionLifetimeInMinutes">SessionLifetimeInMinutes</a> </code> parameter.</p> <p>The resulting user session is valid for 15 minutes (minimum) to 10 hours (maximum). The default session duration is 10 hours.</p> </li> <li> <p>You are charged only when the URL is used or there is interaction with Amazon Quick.</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics.html">Embedded Analytics</a> in the <i>Amazon Quick User Guide</i>.</p> <p>For more information about the high-level steps for embedding and for an interactive demo of the ways you can customize embedding, visit the <a href="https://docs.aws.amazon.com/quicksight/latest/user/quicksight-dev-portal.html">Amazon Quick Developer Portal</a>.</p>

    Args:
        aws_account_id: <p>The ID for the Amazon Web Services account that contains the dashboard that you're embedding.</p>
        session_lifetime_in_minutes: <p>How many minutes the session is valid. The session lifetime must be in [15-600] minutes range.</p>
        user_arn: <p>The Amazon Resource Name for the registered user.</p>
        experience_configuration: <p>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.</p>
        allowed_domains: <p>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.</p> <p>To include all subdomains under a specific domain to the allow list, use <code>*</code>. For example, <code>https://*.sapp.amazon.com</code> includes all subdomains under <code>https://sapp.amazon.com</code>.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>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 Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.quick_sight_user_not_found_exception.QuickSightUserNotFoundException: <p>The user with the provided name isn't found. This error can happen in any operation that requires finding a user based on a provided user name, such as <code>DeleteUser</code>, <code>DescribeUser</code>, and so on.</p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.session_lifetime_in_minutes_invalid_exception.SessionLifetimeInMinutesInvalidException: <p>The number of minutes specified for the lifetime of a session isn't valid. The session lifetime must be 15-600 minutes.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.unsupported_pricing_plan_exception.UnsupportedPricingPlanException: <p>This error indicates that you are calling an embedding operation in Amazon Quick Sight without the required pricing plan on your Amazon Web Services account. Before you can use embedding for anonymous users, a Quick Suite administrator needs to add capacity pricing to Quick Sight. You can do this on the <b>Manage Quick Suite</b> page. </p> <p>After capacity pricing is added, you can use the <code> <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_GetDashboardEmbedUrl.html">GetDashboardEmbedUrl</a> </code> API operation with the <code>--identity-type ANONYMOUS</code> option.</p>
        capo_quicksight.errors.unsupported_user_edition_exception.UnsupportedUserEditionException: <p>This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_quicksight.types.generate_embed_url_for_registered_user_request.GenerateEmbedUrlForRegisteredUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_quicksight.types.generate_embed_url_for_registered_user_response.GenerateEmbedUrlForRegisteredUserResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.generate_embed_url_for_registered_user

        (
            output,
            http_response,
        ) = await capo_quicksight._operations.quick_sight_20180401.generate_embed_url_for_registered_user.async_generate_embed_url_for_registered_user(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_quicksight.types.generate_embed_url_for_registered_user_response.GenerateEmbedUrlForRegisteredUserResponse",
    ) -> dict[str, Any]:
        import capo_quicksight.types.generate_embed_url_for_registered_user_response

        return capo_quicksight.types.generate_embed_url_for_registered_user_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GenerateEmbedUrlForRegisteredUser", redact_output=_redact_output
        ),
    )
    input_: capo_quicksight.types.generate_embed_url_for_registered_user_request.GenerateEmbedUrlForRegisteredUserRequest = {
        "aws_account_id": aws_account_id,
        "user_arn": user_arn,
        "experience_configuration": experience_configuration,
    }
    if session_lifetime_in_minutes is not None:
        input_["session_lifetime_in_minutes"] = session_lifetime_in_minutes
    if allowed_domains is not None:
        input_["allowed_domains"] = allowed_domains

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output