<?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 Re: Uploading a PBIX file using the import API in nodejs in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3588662#M45810</link>
    <description>&lt;P&gt;Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.&lt;BR /&gt;&lt;BR /&gt;Attaching link of that post&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Post-in-Group-API-using-Nodejs/td-p/1054892" target="_blank"&gt;'Post in Group' API using Nodejs - Microsoft Fabric Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Happy sharing&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2023 10:45:44 GMT</pubDate>
    <dc:creator>raviShekhar404</dc:creator>
    <dc:date>2023-12-18T10:45:44Z</dc:date>
    <item>
      <title>Uploading a PBIX file using the import API in nodejs</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3585108#M45787</link>
      <description>&lt;P&gt;Hi folks,&lt;BR /&gt;&lt;BR /&gt;I am facing issue while uploading a PBIX file from local storage using import API. Code is in nodejs. Please find snipshot below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let options = {
    method: 'POST',
    headers: {
        'Content-Type': 'multipart/form-data',
        'authorization': 'Bearer ' + authToken
    },
    body: fs.createReadStream(filePathOnLocal + 'report.pbix'),
    url: `https://api.powerbi.com/v1.0/myorg/groups/${group_id}/imports?datasetDisplayName=report.pbix&amp;amp;nameConflict=CreateOrOverwrite`
};
const result = await axios.request(options)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is giving me error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raviShekhar404_0-1702617813947.png" style="width: 901px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1011455i5EF4513D68693911/image-dimensions/901x228?v=v2" width="901" height="228" role="button" title="raviShekhar404_0-1702617813947.png" alt="raviShekhar404_0-1702617813947.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had found same code in other post, but not sure why I am facing this issue.&lt;BR /&gt;&lt;BR /&gt;Also for verify if file is correct or not, I have called PBI API directly from Postman with same file and it successfully upload the file on desired group. Only for code it is failing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 05:37:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3585108#M45787</guid>
      <dc:creator>raviShekhar404</dc:creator>
      <dc:date>2023-12-15T05:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading a PBIX file using the import API in nodejs</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3588662#M45810</link>
      <description>&lt;P&gt;Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.&lt;BR /&gt;&lt;BR /&gt;Attaching link of that post&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Developer/Post-in-Group-API-using-Nodejs/td-p/1054892" target="_blank"&gt;'Post in Group' API using Nodejs - Microsoft Fabric Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Happy sharing&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 10:45:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3588662#M45810</guid>
      <dc:creator>raviShekhar404</dc:creator>
      <dc:date>2023-12-18T10:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading a PBIX file using the import API in nodejs</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3588668#M45811</link>
      <description>&lt;P&gt;One more observation, with axios only we have to do these changes. Because I have tried with request library(depricated in nodejs) also and it works fine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;let options:any = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;method: 'POST',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;headers: {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'authorization': 'Bearer ' + authToken&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;data:{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"file":{"value":fs.createReadStream(filePath),"options":{"filename":"report.pbix","contentType":null}},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;url: url&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const result = await request(options)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;console.log(result)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Dec 2023 10:48:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Uploading-a-PBIX-file-using-the-import-API-in-nodejs/m-p/3588668#M45811</guid>
      <dc:creator>raviShekhar404</dc:creator>
      <dc:date>2023-12-18T10:48:39Z</dc:date>
    </item>
  </channel>
</rss>

