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.
WebReports API Call Syntax Standard
ServerURL/api/APIController/ReportName/ConnectionProfile/ReportType/Parameters
WebReports API Call Syntax Queue
ServerURL/api/APIController/ReportName/ConnectionProfile/ReportType/Parameters/UseSavedData/SaveFile/ExportType
- Server URL/api/: Web address to the WebReports application on the IIS Server hosting the WebReports 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 WebReports API call. If the parameter values are not included in the WebReports API call, and the report does have parameters, the user will be prompted by the WebReports 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 WebReports API expects the following format: Parameter?CallDate=2016-09-07
- If the Datatype was set to None the WebReports 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 WebReports API expects the following format: Parameter?CallType=IN
- If the Datatype was set to None the WebReports 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 WebReports API expects the following format: Parameter?CallType=10
- Parameter?ParameterName=ParameterValue
- IMPORTANT: When using IN / IN No Parenthesis, older views/calls can still use "," instead of "|,|", but may have an issue if any data has a comma in it.
- Valid Example - Comma in Data (IN Type): ('IN'|,|'MA'|,|'BridgeWorks, VDM')
- Invalid Example - Comma in Data (IN Type): ('IN','MA','BridgeWorks, VDM')
-
-
- Multi Value Example for Dates, Strings or Numerics with a property Type of "IN": The WebReports 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 WebReports API expects the following format for Strings values: Parameter?CallType=('IN'|,|'MA'|,|'UM')
- Calls with no comma in the values/data can use: ('IN','MA','UM')
- When the parameter's Type is set to "IN" the WebReports API expects the following format for Strings values: Parameter?CallType=('IN'|,|'MA'|,|'UM')
- Multi Value Example for Dates, Strings or Numerics with a property Type of "IN": The WebReports 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 WebReports API expects the following format for Date values: Parameter?CallDate=('2016-09-01'|,|'2016-09-02'|,|'2016-09-03')
- Calls with no comma in the values/data can use: ('2016-09-01','2016-09-02','2016-09-03')
- When the parameter's Type is set to "IN" the WebReports API expects the following format for Date values: Parameter?CallDate=('2016-09-01'|,|'2016-09-02'|,|'2016-09-03')
-
-
-
-
-
- When the parameter's Type is set to "IN" the WebReports API expects the following format for Numeric values: Parameter?CallType=(10|,|20|,|30)
- Calls with no comma in the values/data can use: (10,20,30)
- When the parameter's Type is set to "IN" the WebReports 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 WebReports 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 WebReports API expects the following format for Strings values: Parameter?CallType='IN'|,|'MA'|,|'UM'
- Calls with no comma in the values/data can use: 'IN','MA','UM'
- When the parameter's Type is set to "In No Parenthesis" the WebReports 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 WebReports API expects the following format for Date values: Parameter?CallDate='2016-09-01'|,|'2016-09-02'|,|'2016-09-03'
- Calls with no comma in the values/data can use: '2016-09-01','2016-09-02','2016-09-03'
- When the parameter's Type is set to "In No Parenthesis" the WebReports API expects the following format for Date values: Parameter?CallDate='2016-09-01'|,|'2016-09-02'|,|'2016-09-03'
-
-
-
-
-
- When the parameter's Type is set to "In No Parenthesis" the WebReports API expects the following format for Numeric values: Parameter?CallType=10|,|20|,|30
- Calls with no comma in the values/data can use: 10,20,30
- When the parameter's Type is set to "In No Parenthesis" the WebReports API expects the following format for Numeric values: Parameter?CallType=10|,|20|,|30
-
-
-
-
- Parameters that leverage WRUseExplicitValue inside the API call will bypass all split/parsing logic and apply the exact value/syntax into the parameter for query service processing.
- Notes regarding WRUseExplicitValue
- WRUseExplicitValue is intended for variable filter use
- WRuseExplicitValue is intended for parameter types that are not IN / IN No Parenthesis
- Notes regarding WRUseExplicitValue
- Parameters that leverage WRUseExplicitValue inside the API call will bypass all split/parsing logic and apply the exact value/syntax into the parameter for query service processing.
-
-
-
-
- Example without WRUseExplicitValue
-
-
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
-
-
-
- Example with WRUseExplicitValue followed by SQL logic as a parameter value
-
-
https://webreports.bridgeworksllc.com/api/FinishedReport?report=VariableFilterTesting.vdm&Connection=Northwind WebReports&Type=Finished%20Report&Parameters=Parameter?Parameter1=('Support')Parameter?Parameter2=WRUseExplicitValueAND dbo.Users.CompletedTickets = 0
If you'd like to run the sample WebReports API below...
Email support@bridgeworksllc.com for free access to the demo site.
Below is an example WebReports 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 WebReports 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 WebReports 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 WebReports 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&
- UseSavedData: UseSavedData=True&
- 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&UseSavedData=True&SaveFile=True&ExportType=PDF
Below is an example WebReports 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&
- UseSavedData: UseSavedData=True&
- 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&UseSavedData=True&SaveFile=true&ExportType=PDF
Below is an example WebReports 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 WebReports API call for a Finished Report with parameter values passing an explicit value:
IMPORTANT: When WRUseExplicitValue is included in a parameter's value WebReports will bypass all split/parsing logic and apply the EXACT value/syntax into the parameter for query service processing.
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=VariableFilterTesting.vdm&
- ConnectionProfile: Connection=Northwind WebReports&
- ReportType:Type= Type=Finished%20Report&
- Parameter1: Parameters=Parameter?Parameter1=('Support')Parameter?
- * Parameter2 WITH Explicit Value: Parameter2=WRUseExplicitValueAND dbo.Users.CompletedTickets = 0
Click here to try the link below in your browser
https://webreports.bridgeworksllc.com/api/FinishedReport?report=VariableFilterTesting.vdm&Connection=Northwind WebReports&Type=Finished%20Report&Parameters=Parameter?Parameter1=('Support')Parameter?Parameter2=WRUseExplicitValueAND dbo.Users.CompletedTickets = 0
Below is an example WebReports API call for queuing a Finished Report for download:
- Server URL/api/: https://webreports.bridgeworksllc.com/api/
- APIController: FinishedReport?
- ReportName: report=SampleWRAPIReport.vdm&
- ConnectionProfile: Connection=Northwind&
- ReportType:Type= Type=Finished%20Report&
- Parameters:Parameters=Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07&
- UseSavedData: UseSavedData=True&
- 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%20Report&Parameters=Parameter?CallType=('IN','MA','UM')Parameter?CallDate=2016-09-07&UseSavedData=True&SaveFile=true&ExportType=PDF
Comments
0 comments
Please sign in to leave a comment.