Hi,
I've been trying out this feature in SSRS 2017: Develop with the REST APIs for Reporting Services
Based on the SwaggerHub documentation, I'm able to browse my report server using the following URL:
http://localhost/reports/api/v2.0/Reports
Using this feature, I'm also able to create a dataset on the report server and access it by sending HTTP REQUESTS. I'm using Postman to test these HTTP(POST) requests. Following is the URL:
http://localhost/reports/api/v2.0/datasets(dataset-id)/Model.GetData
http://localhost/reports/api/v2.0/datasets(04c53a0a-08eb-4187-b2c1-7e328e18f6d9)/Model.GetData
The above dataset is a storedprocedure which has no parameters and I'm able to get the output in JSON format without any issues.
The problem comes when I have a stored procedure which has parameters, I'm unable to pass in parameters using this REST API feature. Suppose if the parameter for my storedprocedure isuserid, in Postman software there is an option where I can give parameters and the above URL turns to the following:
http://localhost/reports/api/v2.0/datasets(04c53a0a-08eb-4187-b2c1-7e328e18f6d9)/Model.GetData?userid=5But it is not accepting any parameters in this way. I'm getting the following error:
{"error": {"code": "220","message": "The data set could not be processed.","details": [ {"code": "221","target": "@userid","message": "The parameter '@userid' requires a non-empty value." } ] } }
I also gave a default parameter for this dataset while creating it (userid=1), but whatever value I'm passing in through this HTTP request it is still displaying the output for userid=1.
I also tried to send parameters in the body of the request:
{"Parameters": [ {"Name": "userid","Value": "5" } ] }
But still didn't work.
Please let me know if there's a way to make this work.
Thanks & Regards,
Sudhir