Skip to content

get_session_embed_url

get_session_embed_url(
    aws_account_id: AwsAccountId,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    entry_point: Optional[EntryPoint] = None,
    session_lifetime_in_minutes: Optional[SessionLifetimeInMinutes] = None,
    user_arn: Optional[Arn] = None,
) -> GetSessionEmbedUrlResponse

Generates a session URL and authorization code that you can use to embed the Amazon Amazon Quick Sight console in your web server code. Use GetSessionEmbedUrl where you want to provide an authoring portal that allows users to create data sources, datasets, analyses, and dashboards. The users who access an embedded Amazon Quick Sight console need belong to the author or admin security cohort. If you want to restrict permissions to some of these features, add a custom permissions profile to the user with the UpdateUser API operation. Use RegisterUser API operation to add a new user with a custom permission profile attached. For more information, see the following sections in the Amazon Quick User Guide:

Parameters:

  • aws_account_id (AwsAccountId) –

    The ID for the Amazon Web Services account associated with your Amazon Quick Sight subscription.

  • entry_point (Optional[EntryPoint], default: None ) –

    The URL you use to access the embedded session. The entry point URL is constrained to the following paths:

    • /start

    • /start/analyses

    • /start/dashboards

    • /start/favorites

    • /dashboards/DashboardId - where DashboardId is the actual ID key from the Amazon Quick Sight console URL of the dashboard

    • /analyses/AnalysisId - where AnalysisId is the actual ID key from the Amazon Quick Sight console URL of the analysis

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

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

  • 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 type of Amazon Quick users in your account (readers, authors, or admins). They need to be authenticated as one of the following:

    1. Active Directory (AD) users or group members

    2. Invited nonfederated users

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

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.

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

  • 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_session_embed_url(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    entry_point: Optional["capo_quicksight.types.entry_point.EntryPoint"] = None,
    session_lifetime_in_minutes: Optional[
        "capo_quicksight.types.session_lifetime_in_minutes.SessionLifetimeInMinutes"
    ] = None,
    user_arn: Optional["capo_quicksight.types.arn.Arn"] = None,
) -> "capo_quicksight.types.get_session_embed_url_response.GetSessionEmbedUrlResponse":
    """<p>Generates a session URL and authorization code that you can use to embed the Amazon Amazon Quick Sight console in your web server code. Use <code>GetSessionEmbedUrl</code> where you want to provide an authoring portal that allows users to create data sources, datasets, analyses, and dashboards. The users who access an embedded Amazon Quick Sight console need belong to the author or admin security cohort. If you want to restrict permissions to some of these features, add a custom permissions profile to the user with the <code> <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateUser.html">UpdateUser</a> </code> API operation. Use <code> <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RegisterUser.html">RegisterUser</a> </code> API operation to add a new user with a custom permission profile attached. For more information, see the following sections in the <i>Amazon Quick User Guide</i>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics.html">Embedding Analytics</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/quicksight/latest/user/customizing-permissions-to-the-quicksight-console.html">Customizing Access to the Amazon Quick Console</a> </p> </li> </ul>

    Args:
        aws_account_id: <p>The ID for the Amazon Web Services account associated with your Amazon Quick Sight subscription.</p>
        entry_point: <p>The URL you use to access the embedded session. The entry point URL is constrained to the following paths:</p> <ul> <li> <p> <code>/start</code> </p> </li> <li> <p> <code>/start/analyses</code> </p> </li> <li> <p> <code>/start/dashboards</code> </p> </li> <li> <p> <code>/start/favorites</code> </p> </li> <li> <p> <code>/dashboards/<i>DashboardId</i> </code> - where <code>DashboardId</code> is the actual ID key from the Amazon Quick Sight console URL of the dashboard</p> </li> <li> <p> <code>/analyses/<i>AnalysisId</i> </code> - where <code>AnalysisId</code> is the actual ID key from the Amazon Quick Sight console URL of the analysis</p> </li> </ul>
        session_lifetime_in_minutes: <p>How many minutes the session is valid. The session lifetime must be 15-600 minutes.</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 type of Amazon Quick users in your account (readers, authors, or admins). They need to be authenticated as one of the following:</p> <ol> <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> </ol> <p>Omit this parameter for users in the third group, IAM users and IAM role-based sessions.</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_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_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_session_embed_url_request.GetSessionEmbedUrlRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.get_session_embed_url_response.GetSessionEmbedUrlResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.get_session_embed_url

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

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

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetSessionEmbedUrl", redact_output=_redact_output),
    )
    input_: capo_quicksight.types.get_session_embed_url_request.GetSessionEmbedUrlRequest = {
        "aws_account_id": aws_account_id
    }
    if entry_point is not None:
        input_["entry_point"] = entry_point
    if session_lifetime_in_minutes is not None:
        input_["session_lifetime_in_minutes"] = session_lifetime_in_minutes
    if user_arn is not None:
        input_["user_arn"] = user_arn

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