(self, report_ids, dataset_ids, target_workspace_id=None)
return embed_token
Get Embed token for multiple reports, multiple dataset, and an optional target workspace

        Args:
            report_ids (list): Report Ids
            dataset_ids (list): Dataset Ids
            target_workspace_id (str, optional): Workspace Id. Defaults to None.

        Returns:
            EmbedToken: Embed token
Get Embed token for multiple reports, multiple dataset, and an optional target workspace
Get Embed token for multiple reports multiple dataset and an optional target workspace
def get_embed_token_for_multiple_reports_single_workspace(self, report_ids, dataset_ids, target_workspace_id=None):
        '''Get Embed token for multiple reports, multiple dataset, and an optional target workspace

        Args:
            report_ids (list): Report Ids
            dataset_ids (list): Dataset Ids
            target_workspace_id (str, optional): Workspace Id. Defaults to None.

        Returns:
            EmbedToken: Embed token
        '''

        # Note: This method is an example and is not consumed in this sample app

        request_body = EmbedTokenRequestBody()

        for dataset_id in dataset_ids:
            request_body.datasets.append({'id': dataset_id})

        for report_id in report_ids:
            request_body.reports.append({'id': report_id})

        if target_workspace_id is not None:
            request_body.targetWorkspaces.append({'id': target_workspace_id})

        # Generate Embed token for multiple workspaces, datasets, and reports. Refer https://aka.ms/MultiResourceEmbedToken
        embed_token_api = 'https://api.powerbi.com/v1.0/myorg/GenerateToken'
        api_response = requests.post(embed_token_api, data=json.dumps(request_body.__dict__), headers=self.get_request_header())

        if api_response.status_code != 200:
            abort(api_response.status_code, description=f'Error while retrieving Embed token\n{api_response.reason}:\t{api_response.text}\nRequestId:\t{api_response.headers.get("RequestId")}')
        
        api_response = json.loads(api_response.text)
        embed_token = EmbedToken(api_response['tokenId'], api_response['token'], api_response['expiration'])
        return embed_token
def get_embed_token_for_multiple_reports_single_workspace ( self , report_ids , dataset_ids , target_workspace_id = None ) : # Note: This method is an example and is not consumed in this sample app request_body = EmbedTokenRequestBody ( ) for dataset_id in dataset_ids : request_body . datasets . append ( { 'id' : dataset_id } ) for report_id in report_ids : request_body . reports . append ( { 'id' : report_id } ) if target_workspace_id is not None : request_body . targetWorkspaces . append ( { 'id' : target_workspace_id } ) # Generate Embed token for multiple workspaces, datasets, and reports. Refer https://aka.ms/MultiResourceEmbedToken embed_token_api = 'https://api.powerbi.com/v1.0/myorg/GenerateToken' api_response = requests . post ( embed_token_api , data = json . dumps ( request_body . __dict__ ) , headers = self . get_request_header ( ) ) if api_response . status_code != 200 : abort ( api_response . status_code , description = f'Error while retrieving Embed token\n{api_response.reason}:\t{api_response.text}\nRequestId:\t{api_response.headers.get("RequestId")}' ) api_response = json . loads ( api_response . text ) embed_token = EmbedToken ( api_response [ 'tokenId' ] , api_response [ 'token' ] , api_response [ 'expiration' ] ) return embed_token