How to download the saved search data using API

How to download the saved search data using API

Use the below API to download saved search data in CSV or JSON format:
https://www.site24x7.com/api/applog/saved_searches/download/<search_id>/<from_date>/<to_date>?data_format=json&range=1-100&order=desc

The following are the field values passed to the API:

Field Value
Description
search_id

  1. This is the long search ID value taken from the saved search list API.
  2. To get the list of saved searches, use the API: https://www.site24x7.com/app/api/applog/saved_searches
  3. Use the below cURL command to get the search ID:
    $ curl "https://www.site24x7.com/app/api/applog/saved_searches" \
    -X GET \
    -H "Accept: application/json; version=2.0" \
    -H "Authorization: Zoho-oauthtoken 1322.41d9f2cfbd1b7a8f9ef14be125f"
  4. For the above cURL command, the result will be as below:
    {
       "code": 0,
        "message": "success",
      "data": [
        {
         "system_generated": false,
          "query": "logtype=\"Test Log\" and message contains \"exception\"",
           "logtype_id": "10000109515",
           "display_name": "Exception Message",
           "search_properties": {
              "default_widget_type": "number"
          },
     "search_id": "10000109255"
      }
     ]
    }
  5. You can find your search query with the display_name from the result data. Use the search_id value of your respective search query.
from_date
dd-MM-yyyy%20HH:mm  ("from" time value in your account's time zone)
to_date
dd-MM-yyyy%20HH:mm  ("to" time value in your account's time zone)
data_format
csv (for CSV format)
json (for JSON format)
range
1-100 (1 to 100 or 101 to 200) 
You can download up to 1,000 lines at once.
order
asc or desc ("asc" is ascending; "desc" is descending)

Here search_id, from_date, to_date, and data_format are mandatory fields. range is not mandatory for groupby query.

Once you know the search_id, use the API mentioned earlier to download saved search data in CSV or JSON format. 

Below is the sample cURL command to download saved search data in JSON format:
      $ curl "https://www.site24x7.com/api/applog/saved_searches/download/312021000000906003/18-05-2020%2004:16/19-05-2020%2004:16?data_format=json&range=1-500&order=desc" \
    -X GET \
    -H "Accept: application/json; version=2.0" \
    -H "Authorization: Zoho-oauthtoken 1322.41d9f2cfbd1b7a8f9ef14be125f"

Below is the sample cURL command to download saved search data in CSV format:
      $ curl "https://www.site24x7.com/api/applog/saved_searches/download/312021000000906003/18-05-2020%2004:16/19-05-2020%2004:16?data_format=csv&range=101-200&order=desc" \
    -X GET \
    -H "Accept: text/csv; charset=utf-8" \
    -H "Authorization: Zoho-oauthtoken 1322.41d9f2cfbd1b7a8f9ef14be125f"

    • Related Articles

    • Site24x7 Real User Monitoring (RUM) - Data Collection

      When you include Site24x7 RUM beacon script in your web pages, the following data is collected. All data that's being collected is in accordance with GDPR compliance. Performance details of web page load time - Metrics like response time of web page ...
    • Where are Site24x7's physical data storage regions located?

      Site24x7's integrated data centers are located in the US, European Union, India, China, Australia, and Japan. All Site24x7 customer-related data are stored in these physical storage regions. Data Center Primary Data Center Disaster Recovery Data ...
    • No data for service and process in Windows server monitor

      If you see "No Data" for process and service metrics (such as CPU or memory usage of monitored services) in the Site24x7 Windows server monitor user interface, follow the troubleshooting steps below. Run PowerShell Commands Open PowerShell as ...
    • Validating sender email using DKIM authentication

      What is DKIM? DomainKeys Identified Mail (DKIM) is an advanced authentication method used widely by email service providers to verify the email from the point of its origin by validating the email sender. It allows the email senders to authenticate ...
    • Monitor and validate DNS IP changes using regex

      DNS administrators often monitor their DNS servers to detect changes in domain resolution and ensure IP mappings remain secure and accurate. Problem When your organization adds or modifies an IP address for your domain name, it’s critical to: Be ...