none
SSRS API v2.0 DataSet POST - Description RRS feed

  • Question

  • Based on the /DataSets API (https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/DataSets/AddDataSet)

    The POST body is supposed to look like the following

    {
      "Id": "01234567-89ab-cdef-0123-456789abcdef",
      "Name": "string",
      "Description": "string",
      "Path": "string",
      "Type": "Unknown",
      "Hidden": true,
      "Size": 0,
      "ModifiedBy": "string",
      "ModifiedDate": "2017-04-13T15:51:04Z",
      "CreatedBy": "string",
      "CreatedDate": "2017-04-13T15:51:04Z",
      "ParentFolderId": "01234567-89ab-cdef-0123-456789abcdef",
      "ContentType": "string",
      "Content": "string",
      "IsFavorite": true,
      "HasParameters": true,
      "QueryExecutionTimeOut": 0
    }

    But when passing in the Description property it doesn't get set on the newly updated DataSet (which does get created) on the server.  First off, are the APIs yet another half baked SSRS implementation?  

    What does it take to get to Description set on the uploaded DataSet? 

    $datasetsUri = $ReportPortalUri + "/api/v2.0/DataSets"

     $uploadItemPath = "C:\DataSetUpload\MyDataSet.rds"
        $bytes = [System.IO.File]::ReadAllBytes($uploadItemPath)
        $dspayload = @{
            "@odata.type" = "#Model.DataSet";        
            "Name" = "MyDataSet.rds";
            "Path" = "/Datasets";
            "Description" = "USER FRIENDLY DESCRIPTION THAT IS NOT SET";
            "ContentType"="";
            "Content" = [System.Convert]::ToBase64String($bytes);
        } | ConvertTo-Json

        $dSetResponse = Invoke-WebRequest -Uri $datasetsUri -Method Post -Body $dspayload -ContentType "application/json" -UseDefaultCredentials

    Thursday, February 13, 2020 11:16 PM

All replies

  • Hi ,

    I am not quite familiar with powershell calling REST API, but one suggestion is that, you could test you request with Fiddler or postman first see if it works first, then apply them in Powershell script.


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 14, 2020 12:30 PM
  • Based on the swagger documentation the structure of the content body that should be posted to the endpoint should not change.  It's not a matter of the DataSet not being created (because it is), rather it's a matter that all of the information being provided to create the DataSet is not being utilized and configured.
    Friday, February 14, 2020 3:20 PM