Skip to content

get_dashboard_embed_url

get_dashboard_embed_url(
    aws_account_id: AwsAccountId,
    dashboard_id: ShortRestrictiveResourceId,
    identity_type: EmbeddingIdentityType,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    session_lifetime_in_minutes: Optional[SessionLifetimeInMinutes] = None,
    undo_redo_disabled: Optional[Boolean] = None,
    reset_disabled: Optional[Boolean] = None,
    state_persistence_enabled: Optional[Boolean] = None,
    user_arn: Optional[Arn] = None,
    namespace: Optional[Namespace] = None,
    additional_dashboard_ids: Optional[AdditionalDashboardIdList] = None,
) -> GetDashboardEmbedUrlResponse

Generates a temporary session URL and authorization code(bearer token) that you can use to embed an Amazon Quick Sight read-only dashboard in your website or application. Before you use this command, make sure that you have configured the dashboards and permissions.

Currently, you can use GetDashboardEmbedURL only from the server, not from the user's browser. The following rules apply to the generated URL:

  • They must be used together.

  • They can be used one time only.

  • They are valid for 5 minutes after you run this command.

  • You are charged only when the URL is used or there is interaction with Quick.

  • The resulting user session is valid for 15 minutes (default) up to 10 hours (maximum). You can use the optional SessionLifetimeInMinutes parameter to customize session duration.

For more information, see Embedding Analytics Using GetDashboardEmbedUrl 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.

  • dashboard_id (ShortRestrictiveResourceId) –

    The ID for the dashboard, also added to the Identity and Access Management (IAM) policy.

  • identity_type (EmbeddingIdentityType) –

    The authentication method that the user uses to sign in.

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

    How many minutes the session is valid. The session lifetime must be 15-600 minutes.

  • undo_redo_disabled (Optional[Boolean], default: None ) –

    Remove the undo/redo button on the embedded dashboard. The default is FALSE, which enables the undo/redo button.

  • reset_disabled (Optional[Boolean], default: None ) –

    Remove the reset button on the embedded dashboard. The default is FALSE, which enables the reset button.

  • state_persistence_enabled (Optional[Boolean], default: None ) –

    Adds persistence of state for the user session in an embedded dashboard. Persistence applies to the sheet and the parameter settings. These are control settings that the dashboard subscriber (Amazon Quick Sight reader) chooses while viewing the dashboard. If this is set to TRUE, the settings are the same when the subscriber reopens the same dashboard URL. The state is stored in Amazon Quick Sight, not in a browser cookie. If this is set to FALSE, the state of the user session is not persisted. The default is FALSE.

  • user_arn (Optional[Arn], default: None ) –

    The Amazon Quick user's Amazon Resource Name (ARN), for use with QUICKSIGHT identity type. You can use this for any Amazon Quick users in your account (readers, authors, or admins) authenticated as one of the following:

    • Active Directory (AD) users or group members

    • Invited nonfederated users

    • IAM users and IAM role-based sessions authenticated through Federated Single Sign-On using SAML, OpenID Connect, or IAM federation.

    Omit this parameter for users in the third group – IAM users and IAM role-based sessions.

  • namespace (Optional[Namespace], default: None ) –

    The Amazon Quick Sight namespace that contains the dashboard IDs in this request. If you're not using a custom namespace, set Namespace = default.

  • additional_dashboard_ids (Optional[AdditionalDashboardIdList], default: None ) –

    A list of one or more dashboard IDs that you want anonymous users to have tempporary access to. Currently, the IdentityType parameter must be set to ANONYMOUS because other identity types authenticate as Quick or IAM users. For example, if you set "--dashboard-id dash_id1 --dashboard-id dash_id2 dash_id3 identity-type ANONYMOUS", the session can access all three dashboards.

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.

  • DomainNotWhitelistedException –

    The domain specified isn't on the allow list. All domains for embedded dashboards must be added to the approved list by an Amazon Quick Suite admin.

  • IdentityTypeNotSupportedException –

    The identity type specified isn't supported. Supported identity types include IAM and QUICKSIGHT.

  • 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.

  • ResourceExistsException –

    The resource specified already exists.

  • 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/quick_sight.py
def get_dashboard_embed_url(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    dashboard_id: "capo_quicksight.types.short_restrictive_resource_id.ShortRestrictiveResourceId",
    identity_type: "capo_quicksight.types.embedding_identity_type.EmbeddingIdentityType",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    session_lifetime_in_minutes: Optional[
        "capo_quicksight.types.session_lifetime_in_minutes.SessionLifetimeInMinutes"
    ] = None,
    undo_redo_disabled: Optional["capo_quicksight.types.boolean.Boolean"] = None,
    reset_disabled: Optional["capo_quicksight.types.boolean.Boolean"] = None,
    state_persistence_enabled: Optional[
        "capo_quicksight.types.boolean.Boolean"
    ] = None,
    user_arn: Optional["capo_quicksight.types.arn.Arn"] = None,
    namespace: Optional["capo_quicksight.types.namespace.Namespace"] = None,
    additional_dashboard_ids: Optional[
        "capo_quicksight.types.additional_dashboard_id_list.AdditionalDashboardIdList"
    ] = None,
) -> "capo_quicksight.types.get_dashboard_embed_url_response.GetDashboardEmbedUrlResponse":
    """<p>Generates a temporary session URL and authorization code(bearer token) that you can use to embed an Amazon Quick Sight read-only dashboard in your website or application. Before you use this command, make sure that you have configured the dashboards and permissions. </p> <p>Currently, you can use <code>GetDashboardEmbedURL</code> only from the server, not from the user's browser. The following rules apply to the generated URL:</p> <ul> <li> <p>They must be used together.</p> </li> <li> <p>They can be used one time only.</p> </li> <li> <p>They are valid for 5 minutes after you run this command.</p> </li> <li> <p>You are charged only when the URL is used or there is interaction with Quick.</p> </li> <li> <p>The resulting user session is valid for 15 minutes (default) up to 10 hours (maximum). You can use the optional <code>SessionLifetimeInMinutes</code> parameter to customize session duration.</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics-deprecated.html">Embedding Analytics Using GetDashboardEmbedUrl</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>
        dashboard_id: <p>The ID for the dashboard, also added to the Identity and Access Management (IAM) policy.</p>
        identity_type: <p>The authentication method that the user uses to sign in.</p>
        session_lifetime_in_minutes: <p>How many minutes the session is valid. The session lifetime must be 15-600 minutes.</p>
        undo_redo_disabled: <p>Remove the undo/redo button on the embedded dashboard. The default is FALSE, which enables the undo/redo button.</p>
        reset_disabled: <p>Remove the reset button on the embedded dashboard. The default is FALSE, which enables the reset button.</p>
        state_persistence_enabled: <p>Adds persistence of state for the user session in an embedded dashboard. Persistence applies to the sheet and the parameter settings. These are control settings that the dashboard subscriber (Amazon Quick Sight reader) chooses while viewing the dashboard. If this is set to <code>TRUE</code>, the settings are the same when the subscriber reopens the same dashboard URL. The state is stored in Amazon Quick Sight, not in a browser cookie. If this is set to FALSE, the state of the user session is not persisted. The default is <code>FALSE</code>.</p>
        user_arn: <p>The Amazon Quick user's Amazon Resource Name (ARN), for use with <code>QUICKSIGHT</code> identity type. You can use this for any Amazon Quick users in your account (readers, authors, or admins) authenticated as one of the following:</p> <ul> <li> <p>Active Directory (AD) users or group members</p> </li> <li> <p>Invited nonfederated users</p> </li> <li> <p>IAM users and IAM role-based sessions authenticated through Federated Single Sign-On using SAML, OpenID Connect, or IAM federation.</p> </li> </ul> <p>Omit this parameter for users in the third group – IAM users and IAM role-based sessions.</p>
        namespace: <p>The Amazon Quick Sight namespace that contains the dashboard IDs in this request. If you're not using a custom namespace, set <code>Namespace = default</code>.</p>
        additional_dashboard_ids: <p>A list of one or more dashboard IDs that you want anonymous users to have tempporary access to. Currently, the <code>IdentityType</code> parameter must be set to <code>ANONYMOUS</code> because other identity types authenticate as Quick or IAM users. For example, if you set "<code>--dashboard-id dash_id1 --dashboard-id dash_id2 dash_id3 identity-type ANONYMOUS</code>", the session can access all three dashboards.</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.domain_not_whitelisted_exception.DomainNotWhitelistedException: <p>The domain specified isn't on the allow list. All domains for embedded dashboards must be added to the approved list by an Amazon Quick Suite admin.</p>
        capo_quicksight.errors.identity_type_not_supported_exception.IdentityTypeNotSupportedException: <p>The identity type specified isn't supported. Supported identity types include <code>IAM</code> and <code>QUICKSIGHT</code>.</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_exists_exception.ResourceExistsException: <p>The resource specified already exists. </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.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.get_dashboard_embed_url_request.GetDashboardEmbedUrlRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.get_dashboard_embed_url_response.GetDashboardEmbedUrlResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.get_dashboard_embed_url

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.get_dashboard_embed_url.get_dashboard_embed_url(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return (
            capo_quicksight.types.get_dashboard_embed_url_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetDashboardEmbedUrl", redact_output=_redact_output),
    )
    input_: capo_quicksight.types.get_dashboard_embed_url_request.GetDashboardEmbedUrlRequest = {
        "aws_account_id": aws_account_id,
        "dashboard_id": dashboard_id,
        "identity_type": identity_type,
    }
    if session_lifetime_in_minutes is not None:
        input_["session_lifetime_in_minutes"] = session_lifetime_in_minutes
    if undo_redo_disabled is not None:
        input_["undo_redo_disabled"] = undo_redo_disabled
    if reset_disabled is not None:
        input_["reset_disabled"] = reset_disabled
    if state_persistence_enabled is not None:
        input_["state_persistence_enabled"] = state_persistence_enabled
    if user_arn is not None:
        input_["user_arn"] = user_arn
    if namespace is not None:
        input_["namespace"] = namespace
    if additional_dashboard_ids is not None:
        input_["additional_dashboard_ids"] = additional_dashboard_ids

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output