ActiveReports 19 .NET Edition
Report Authors / Report Wizard / Configuring Data Source / Configuring Web API Data Source
In This Topic
    Configuring Web API Data Source
    In This Topic

    If you selected the JSON API data source in the Web API section, the next screen of the report wizard allows you to connect your report to data provided by a web service via an HTTP request. This type of data source is particularly useful when working with RESTful APIs or other web-based services. The following sections describe the connection settings in detail.

    Fixed and Dynamic Settings

    Connection settings can either be fixed or dynamic:

    To make a setting dynamic, click the Parameter... or Insert parameter... link near the setting name:

    General Section in Configure Web API Request 

    This will open the Parameters dialog:

    Add Parameter for Web API Request 

    Here, you can re-use an existing parameter or create a new one by clicking the Add button. The following properties can be configured:

    When you can click the OK button and the reference to the selected parameter will be inserted in the connection setting, for example, the URL will be set to {url}.

    Advantages of Dynamic Settings

    Dynamic settings offer flexibility, especially in environments where connection details might change or where different users require different settings. For example, you might want to use different URLs depending on the current environment.

    Configuring JSON API Connection

    Configure Web API Request screen

    General Settings

    HTTP Method

    Select the HTTP method to be used for the API request. The available options are:

    HTTP Headers:

    Click on the HTTP Headers... button to add custom headers to the API request. This might include headers for authentication (e.g., Bearer tokens), content type (e.g., application/json), or other necessary metadata required by the API. You can make the header value dynamic by using the Parameter link as described above. 

    Add Custom HTTP Headers to Web API Request

    Test the API Request

    Before finalizing the configuration, it's important to test the API request to ensure it is functioning as expected. Click the Test Request button and check the message in the popup dialog. If the request was configured correctly, the message will look like this:

    Success Message to Adding Custom Headers to Web API Request 

    If the request was not configured properly, the error message will be displayed, and you can click the Details >> button for more information:

    Error Message to Adding Custom Headers to Web API Request 

    Proceeding to Next Steps

    Once you have configured the connection, click Next > to proceed to the Configure JSON Queries step of the report wizard.