Error while embedding Q Search Bar following Docs,

Hello,

I am trying to embed Quicksight Q search bar in internal application ,
i have created a Lambda and used the boto3 client in python for Quicksight q ,

following this doc,

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/quicksight.html#QuickSight.Client.generate_embed_url_for_registered_user

response = client.generate_embed_url_for_registered_user(
    AwsAccountId='string',
    SessionLifetimeInMinutes=123,
    UserArn='string',
    ExperienceConfiguration={
        'Dashboard': {
            'InitialDashboardId': 'string'
        },
        'QuickSightConsole': {
            'InitialPath': 'string'
        },
        'QSearchBar': {
            'InitialTopicId': 'string'
        }
    }
)

i have created a below function ,

I am getting the below error message , when the function “generate_embed_url_for_registered_user” is called …

def QSearchBar(awsAccountId,region,qTopicId):
quickSight = boto3.client('quicksight', region_name='us-east-1')
print("inside QS function \n ")
print("before response")
response = quickSight.generate_embed_url_for_registered_user(
AwsAccountId = awsAccountId,
UserArn = 'arn:aws:quicksight:'+ region + ':' + awsAccountId + ':user/default/' + roleName + '/' + userName,
SessionLifetimeInMinutes = 60,
ExperienceConfiguration = { 'QSearchBar': {'InitialTopicId': qTopicId} }
)
print("response",response)
return response["EmbedUrl"]

But when doing so , “invalid configuration parameter error , must be either dashboard or session”

even though I have followed as per the docs i am getting this error.

Hi @nikhilrr -

Check your version of the SDK. You may need to update. QSearchBar requires >= 1.19.2. boto3/CHANGELOG.rst at develop · boto/boto3 · GitHub

Thanks , updating to latest version worked

1 Like