Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I want to publish a Power BI report by using a Rest API and I am getting an error

RequestedFileIsEncryptedOrCorrupted error

These are the steps I followed

Request Data 

POST /v1.0/myorg/groups/{groupId}/imports/createTemporaryUploadLocation HTTP/1.1
Host: api.powerbi.com
Authorization: Bearer {token}
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Host: api.powerbi.com
Accept-Encoding: gzip, deflate
Content-Length: 0
Connection: keep-alive
cache-control: no-cache

Return

{
  "@odata.context": "",
  "url": "",
  "expirationTime": ""
}

The URL sends the following Request

PUT {url from step 1} HTTP/1.1
Host: wabieus2bppbiv2.blob.core.windows.net
x-ms-blob-type: BlockBlob
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Host: wabieus2bppbiv2.blob.core.windows.net
Content-Type: multipart/form-data;
Accept-Encoding: gzip, deflate
Content-Length: 2057012
Connection: keep-alive
cache-control: no-cache

 

Content-Disposition: form-data; name="file"; filename="{local pbix file path here} 

Request responds 201

and I send publish report call

POST /v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={name}& nameConflict=CreateOrOverwrite& skipReport=False HTTP/1.1
Host: api.powerbi.com
Content-Type: multipart/form-data;
cache-control: no-cache

Content-Disposition: form-data; name="fileUrl"
 

     and here I am getting an error

    {
      "error": {
        "code": "RequestedFileIsEncryptedOrCorrupted",
        "pbi.error": {
          "code": "RequestedFileIsEncryptedOrCorrupted",
          "parameters": {},
          "details": [],
          "exceptionCulprit": 1
        }
      }
    }

    1 Answer

    0 votes
    by (22.5k points)
    edited by

    This kind of error occurs when we don't give authentication information in a proper format. Check the value of the authentication header

    Are you planning to be a Power BI professional? Read on this Power BI Developer blog provided by Intellipaat.

    Also, do check out our YouTube video on Power BI basics to help you gain more insight to get started:

    If you want to learn more about Power BI, then read the Power BI Tutorial. Also, enroll in Power BI Certification training to become proficient in this BI tool.

    Related questions

    Browse Categories

    ...