<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Forbidden Issue with PowerBiClient in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Forbidden-Issue-with-PowerBiClient/m-p/3158314#M53645</link>
    <description>&lt;P&gt;Hi Geeks,&lt;BR /&gt;Currently I am working with Power Bi apis and embedding. I have tried to get embed token using powerBi client by &lt;EM&gt;pbiClient.Reports.GenerateTokenAsync()&lt;/EM&gt; method. But I got exception , says &lt;EM&gt;"Operation returned an invalid status code 'Forbidden'" &lt;/EM&gt;.&lt;BR /&gt;I have given '&lt;STRONG&gt;workspaceId&lt;/STRONG&gt;', '&lt;STRONG&gt;reportId&lt;/STRONG&gt;', '&lt;STRONG&gt;tokenRequest&lt;/STRONG&gt; ' as parameters. wokspaceId and reportId are correct. tokenRequest is a &lt;STRONG&gt;GenerateTokenRequest&lt;/STRONG&gt; object and value of it when it passes to pbiClient.Reports.GenerateTokenAsync() method is :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;AccessLevel : {View}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;AllowSaveAs : null&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;DatasetId : //a dataset id&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Identities : null&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;LifetimeInMinutes : null&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to enable something while creating or publishing report for embed a pbi report either in PowerBi Desktop or in my code ?&lt;BR /&gt;What do you think about the conditions to get that exception ?&lt;/P&gt;&lt;P&gt;Did I miss any any information ? please let me know.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note&lt;/U&gt;:&lt;BR /&gt;**I am incharge for generate tokens, embedURLs etc and, powerBi report making and publishing is done by some one else**&lt;BR /&gt;My project have already embedded so many report as far. I am experiencing this issue while trying to adding/embedding newly created Bi reports.&lt;BR /&gt;Woking on &lt;STRONG&gt;.NET6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 11:24:23 GMT</pubDate>
    <dc:creator>Irshad_aj</dc:creator>
    <dc:date>2023-03-28T11:24:23Z</dc:date>
    <item>
      <title>Forbidden Issue with PowerBiClient</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Forbidden-Issue-with-PowerBiClient/m-p/3158314#M53645</link>
      <description>&lt;P&gt;Hi Geeks,&lt;BR /&gt;Currently I am working with Power Bi apis and embedding. I have tried to get embed token using powerBi client by &lt;EM&gt;pbiClient.Reports.GenerateTokenAsync()&lt;/EM&gt; method. But I got exception , says &lt;EM&gt;"Operation returned an invalid status code 'Forbidden'" &lt;/EM&gt;.&lt;BR /&gt;I have given '&lt;STRONG&gt;workspaceId&lt;/STRONG&gt;', '&lt;STRONG&gt;reportId&lt;/STRONG&gt;', '&lt;STRONG&gt;tokenRequest&lt;/STRONG&gt; ' as parameters. wokspaceId and reportId are correct. tokenRequest is a &lt;STRONG&gt;GenerateTokenRequest&lt;/STRONG&gt; object and value of it when it passes to pbiClient.Reports.GenerateTokenAsync() method is :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;AccessLevel : {View}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;AllowSaveAs : null&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;DatasetId : //a dataset id&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Identities : null&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;LifetimeInMinutes : null&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to enable something while creating or publishing report for embed a pbi report either in PowerBi Desktop or in my code ?&lt;BR /&gt;What do you think about the conditions to get that exception ?&lt;/P&gt;&lt;P&gt;Did I miss any any information ? please let me know.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Note&lt;/U&gt;:&lt;BR /&gt;**I am incharge for generate tokens, embedURLs etc and, powerBi report making and publishing is done by some one else**&lt;BR /&gt;My project have already embedded so many report as far. I am experiencing this issue while trying to adding/embedding newly created Bi reports.&lt;BR /&gt;Woking on &lt;STRONG&gt;.NET6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 11:24:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Forbidden-Issue-with-PowerBiClient/m-p/3158314#M53645</guid>
      <dc:creator>Irshad_aj</dc:creator>
      <dc:date>2023-03-28T11:24:23Z</dc:date>
    </item>
  </channel>
</rss>

