Generating Reports via API
    • 02 Jul 2024
    • 1 Minute to read
    • Contributors
    • PDF

    Generating Reports via API

    • PDF

    Article summary

    ACE remote API access enables external calls using the SQL Reporting Engine in ACE. This procedure covers generating an API key, fetching a report, and filtering data from a SQL report using JSON parameters.

    Note

    A SQL report must already exist for this procedure. Additionally, a basic understanding of JSON is required to work with the JSON parameters in the API calls.

    Generating  API Key for Remote API Access

    1. Generate a remote API access key in the user profile.

    2. Save the user after generating the key.

    3. For enhanced security, regenerate the key every 120 days.

    4. View Generate API Key for user for details.

    Grab the Report Identifier

    1. Go to Reports → SQL Designer.

    2. Copy the Report Identifier from the field.

    Fetching a Report: Constructing the URL

    This procedure covers developing the URL to pull a report without filtering data. 

    1. Go to Help → API Documentation.

    2. Navigate to the Reports section.

    3. Click "Post" and then click "Try it out".

    4. Fill in the required information:

      1. customerID*

      2. identifier* (Report Identifier) 

      3. type* (Custom,Inventory )

      4. generate* (true)

    5. Click "Execute" and copy the requested URL.

    6. Open new web browser, paste the URL to view the report.


    GIF Demonstrates Steps 1-6

     

     

    Passing Report Parameters via API: Applying Date Range Filters

    To generate a report with date range filters, follow these steps:

    1. Identify the parameters needed to filter data from the SQL report. For example, the createDate parameter.

    2. Use a  tool like https://www.urlencoder.org/ to encode the JSON parameters.

      1. Enter the JSON parameters in the tool and click Encode.

      2. [{ "name": "createDate", "valueStart": "01/01/2023", "valueEnd": "07/01/2023" }] 
    3. Construct the final URL: paste the original URL into a browser, add "&params=" then append the encoded parameter.

    4. Test and verify the report URL.

                                                         

    Original URL:

    https://test.interprose.com/report/runner.do?customerID=GINA&identifier=VIEWED_ACCOUNTS&type=CUSTOM&generate=true


    Encoded parameters: 

    %5B%7B%0A%20%20"name"%3A%20"createDate"%2C%0A%20%20"valueStart"%3A%20"01%2F01%2F2023"%2C%0A%20%20"valueEnd"%3A%20"07%2F01%2F2023"%0A%7D%5D%0A%5B%7B%0A%20%20"name"%3A%20"DateRange"%2C%0A%20%20"valueStart"%3A%20"01%2F01%2F2023"%2C%0A%20%20"valueEnd"%3A%20"07%2F01%2F2023"%0A%7D%5D%0A

    Final URL with encoded parameters:

    https://test.interprose.com/report/runner.do?customerID=GINA&identifier=VIEWED_ACCOUNTS&type=CUSTOM&generate=true&params=%5B%7B%0A%20%20%22name%22%3A%20%22createDate%22%2C%0A%20%20%22valueStart%22%3A%20%2201%2F01%2F2023%22%2C%0A%20%20%22valueEnd%22%3A%20%2207%2F01%2F2023%22%0A%7D%5D%0A%5B%7B%0A%20%20%22name%22%3A%20%22DateRange%22%2C%0A%20%20%22valueStart%22%3A%20%2201%2F01%2F2023%22%2C%0A%20%20%22valueEnd%22%3A%20%2207%2F01%2F2023%22%0A%7D%5D%0A

    Parameter and URL Details

    Ensure that the parameter names, URL string values, and variables are correctly provided:

    • "customerID": Your ACE Customer ID (e.g., &customerID=CUSTID)

    • "type": Defines the type of ACE report (e.g., Custom, Inventory)

    • "identifier": Represents the report identifier (e.g., &identifier=REPORT_IDENTIFIER)

    • "apiKey": The key generated on the user page. Save the user after generating the key and use it as a Bearer token.

    • "generate": A value of "true" instructs the report engine to execute.

    • "params": Allows passing report parameters/options as a JSON array (e.g., &params=[{name:"agencyNumber",value:"123456721"}])

    The API call will run as the user associated with the API key.


    For any questions or assistance, contact our Support team.







    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence