WebReports API URL Calls
The WebReports API allows developers and users to call WebReports from their native applications or bookmark their favorite reports with predefined parameters. There are two options when sending API commands; Standard - runs and opens the report in browser, Queue - Runs the report in the background an emails the user when completed.
Web Reports API Call Syntax Standard
ServerURL/api/APIController/ReportName/ConnectionProfile/ReportType/Parameters
Web Reports API Call Syntax Queue
ServerURL/api/APIController/ReportName/ConnectionProfile/ReportType/Parameters/SaveFile/ExportType
- Server URL/api/: Web address to the Web Reports application on the IIS Server hosting the Web Reports API.
- APIController: API Controller Name used to display the report's output.
- FinishedReport - Calls the Finished Report Controller.
-
Visualize - Calls the Data Visualization Controller.
- ReportName: Name of the VDM Report to be executed.
- ConnectionProfile: Database Connection Profile that will be used when executing the Report.
- ReportType: Report type that will be displayed in browser.
- Finished Report - Displays the report in browser for Finished Reports.
-
Visualize - Displays the report in browser for Visualize. (not available with the Queue option)
-
UseSavedData: UseSavedData=True& is needed to queue / download completed reports
- SaveFile: When set to true, the report will be queued and run in the background opposed to running in the browser.
- ExportType: Determines the file type when exported using the Queue. Available options are PDF, XLSX, XLS, RTF.
- Parameters: Parameters provide variable input to the report at the time of execution and is an optional component of the Web Reports API call. If the parameter values are not included in the Web Reports API call, and the report does have parameters, the user will be prompted by the Web Reports server for input. The parameter's "Datatype" and "Object Identifier" properties defined within the Report's settings determine if the parameter values provided in the API call require single quotes around Date and String values.
- Parameter?ParameterName=ParameterValue
- Single Value Example for Dates: In the image below the parameter "CallDate" has a defined Datatype of "DateTime" and Object Identifier of " ' " (single quote). This property configuration tells VDM that the expected parameter value's Dataype is a DateTime and to place single quotes around the provided value. In this scenario the Web Reports API expects the following format: Parameter?CallDate=2016-09-07
- If the Datatype was set to None the Web Reports API would expect the following format: Parameter?CallDate='2016-09-07'
- Single Value Example for Strings: In the image below the parameter "CallType" has a defined Datatype of "String" and Object Identifier of " ' " (single quote). This property configuration tells VDM that the expected parameter value's Dataype is a String and to place single quotes around the provided value. In this scenario the Web Reports API expects the following format: Parameter?CallType=IN
- If the Datatype was set to None the Web Reports API would expect the following format: Parameter?CallType='IN'
- Single Value Example for Numerics: In the image below the parameter "CallType" has a defined Datatype of "Integer" and Object Identifier of " ' " (single quote). Parameters with Datatype's of Integer and Decimal ignore the Object Identifier as the expected value is a numeric. In this scenario the Web Reports API expects the following format: Parameter?CallType=10
-
Multi Value Example for Dates, Strings or Numerics with a property Type of "IN": The Web Reports API ignores the "Dataype" and "Object Identifier" properties when used with a property Type of "IN".
- When the parameter's Type is set to "IN" the Web Reports API expects the following format for Strings values: Parameter?CallType=('IN','MA','UM')
- When the parameter's Type is set to "IN" the Web Reports API expects the following format for Date values: Parameter?CallType=('2016-09-01','2016-09-02','2016-09-03')
- When the parameter's Type is set to "IN" the Web Reports API expects the following format for Numeric values: Parameter?CallType=(10,20,30)
-
-
Multi Value Example for Dates, Strings or Numerics with a property Type of "IN No Parenthesis": The Web Reports API ignores the "Dataype" and "Object Identifier" properties when used with a property Type of "IN No Parenthesis".
- When the parameter's Type is set to "In No Parenthesis" the Web Reports API expects the following format for Strings values: Parameter?CallType='IN','MA','UM'
- When the parameter's Type is set to "In No Parenthesis" the Web Reports API expects the following format for Date values: Parameter?CallType='2016-09-01','2016-09-02','2016-09-03'
- When the parameter's Type is set to "In No Parenthesis" the Web Reports API expects the following format for Numeric values: Parameter?CallType=10,20,30
If you'd like to run the sample Web Reports API below...
Email support@bridgeworksllc.com for free access to the demo site.
Below is an example Web Reports API call for a Finished Report with parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType: Type=Finished%20Report&
- Parameters: Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/FinishedReport?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Finished%20Report&Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07
Below is an example Web Reports API call for a Data Visualization with parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: Visualize?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType:Type=Visualize&
- Parameters: Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/Visualize?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Visualize&Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07
Below is an example Web Reports API call for a Finished Report without passing parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType: Finished Report
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/FinishedReport?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Finished Report&
Below is an example Web Reports API call to queue a Finished Report without passing parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType: Type=Finished Report&
- SaveFile: SaveFile=True&
- ExportType: ExportType=PDF
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/FinishedReport?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Finished Report&SaveFile=True&ExportType=PDF
Below is an example Web Reports API call to queue a Finished Report with parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType: Type=Finished Report&
- Parameters: Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07&
- SaveFile: SaveFile=true&
- ExportType: ExportType=PDF
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/FinishedReport?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Finished Report&Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07&SaveFile=true&ExportType=PDF
Below is an example Web Reports API call to queue a Data Visualization with parameter values:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: Visualize?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=ABCLocal&
- ReportType:Type=Visualize&
- Parameters: Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07&
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/Visualize?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Visualize&Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07
Below is an example Web Reports API call for a Finished Report with parameter values passing an explicit value:
- Server URL/api/: https://webreports.bridgeworksllc.com:444/api/
- APIController: FinishedReport?
- ReportName: report=VariableFilterTesting.vdm&
- ConnectionProfile: Connection=Northwind&
- ReportType:Type= Type=Finished%20Report&
- Parameter1: Parameters=Parameter?Parameter1=('Support')Parameter?
- Parameter2 WITH Explicit Value: Parameter2=WRUseExplicitValueAND dbo.Users.CompletedTickets = 0
https://webreports.bridgeworksllc.com:444/api/FinishedReport?report=VariableFilterTesting.vdm&Connection=Northwind&Type=Finished%20Report&Parameters=Parameter?Parameter1=('Support')Parameter?Parameter2=WRUseExplicitValueAND dbo.Users.CompletedTickets = 0
Below is an example Web Reports API call for queuing a Finished Report for download:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=VariableFilterTesting.vdm&
- ConnectionProfile: Connection=Northwind&
- ReportType:Type= Type=Finished%20Report&
- Parameters:Parameters=Parameter%3FCallType%3D%28%27IN%27%2c%27MA%27%2c%27UM%27%29Parameter%3FCallDate%3D2016-09-07&
- UseSavedData: UseSavedData=True&
- SaveFile: SaveFile=true&
- ExportType: ExportType=PDF
https://webreports.bridgeworksllc.com/api/FinishedReport?report=SampleWRAPIReport.vdm&Connection=ABCLocal&Type=Finished%20Report&Parameters=Parameter%3FCallType%3D%28%27IN%27%2c%27MA%27%2c%27UM%27%29Parameter%3FCallDate%3D2016-09-07&UseSavedData=True&SaveFile=true&ExportType=PDF
Comments
0 comments
Please sign in to leave a comment.