Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Problem with new new REST API and report datasources

I am having problems with the new SSRS REST API, in particular relinking uploaded reports to their datasources. Microsoft have confirmed that the API doc as published is not correct in that the PUT o...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Solved myself - by increasing tracing level on PBIRS logs and seeing a complaint about JSON payload not matching to an array type. I only had one datasource and due to the amazingly stupid mapping of single-item arrays into the bare item which Powershell does in some circumstances, the endpoint was not getting a JSON array. Fix was to replace:

     

    $body = $ret.value | ConvertTo-Json

     with

     

    $body = ConvertTo-Json $ret.value

     

    because the pipe invokes the stupid array unwrapping. This silly behaviour of Powershell is particularly annoying in APIs where datatypes matter so much.