Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rebinding Paginated Reports (RDLs) via the API

Just wondering if anyone has been able to rebind a Paginated report dataset after import via the api?

 

Currently what I am getting is a 400 error.

 

I can rebind PBIX reports, just not RDLs.

 

Basic Code snippet.

$rebindBody = @{ datasetId =  "datasetGUID"} | ConvertTo-Json
$response = Invoke-PowerBIRestMethod -Url "groups/$workspaceId/reports/$reportId/Rebind"  -Method POST -Body  $rebindBody
 
Kind Regards
Charles
 
  • Hi Anonymous ,


    Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

    Best Regards
    Lucien

3 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi Anonymous ,

    A 400 status code means that the server could not process an API request due to invalid syntax. A few possibilities why this might happen are:

    • A typo or mistake while building out the request manually, such as mistyping the API endpoint, a header name or value, or a query parameter. This can also be caused if the request is missing a required query parameter, or the query parameter value is invalid or missing

    • A malformed JSON body, for example, missing a set of double-quotes, or a comma. If you need to make an API request with a JSON body, I highly recommend writing it using a linter, whether you use a web editor or code editor plugin

    • The request is missing authentication information, or the Authorization header provided could not be validated

    The main advice when debugging a 400 Bad Request error is to review every piece of text. Make sure there are no typos in the endpoint, headers (name and values), and body. If you copied and pasted any part of your API request, pay extra attention that they don't include any mistakes or random characters that could be causing an issue.

    Our last bullet point above (missing authentication information) is a good example of something you might see when working with multiple APIs. One API might send you a 400 status code for a request that has invalid authentication credentials, while another one might send you a 401 unauthorized status code, which can be used specifically for that purpose.

    The 400 bad request status code sometimes is used as a catch-all for multiple types of errors. So if you have checked your API request for any invalid syntax and haven't found any errors, try to see if any of the other 4xx status code solutions could help you with debugging.

     

    refer :

    https://docs.microsoft.com/en-us/rest/api/power-bi/reports/rebind-report 

    https://docs.microsoft.com/en-us/power-bi/paginated-reports/paginated-reports-faq 

     

     


    Best Regards

    Lucien

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi Anonymous ,


    Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

    Best Regards
    Lucien

  • Hello, 

    I have the same need (rebind a paginated report to new dataset) and the same problem, 400 Bad request.  

    My json body, my token, my URL are all good as I validated them by using exactely the same request in Postman and only changed the reportId (from a paginated report ID to a pbix report ID).

    The request is working fine with pbix reports and returning 400 bad request with paginated reports.

    URL:

    https://api.powerbi.com/v1.0/myorg/groups/XXXXXXYYYYYYYYYYYZZZZZZZZZ/reports/XXXXXXXXXXXXXXYYYYYYYYY...

     

    json body:

    {
      "datasetId""XXXXXXXXXXXEEEEEEEEEEEAAAAAAAAAAAA"
    }
     
    Is it a known issue? Could someone help me please ?
     
    thanks