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

    • How to manually download and enable the Network Module in an On-Premise Poller

      Please follow the steps given below to manually download and enable the Network Module for the On-Premise Poller: Stop the On-Premise Poller service. Ensure that there are no existing processes in the On-Premise Poller . Check if there is a folder ...
    • Troubleshooting data collection issues while using SNMP v3 credentials

      When data collection stops, check: If data collection has stopped for only a particular device or for all devices. If any out of memory (OOM) files are present in the following folder: {poller directory}/NetworkPlus/bin folder The credential ...
    • How to update the API key for Azure AI Search

      It is mandatory to update the API key for the Azure AI Search service monitor to view the Statistics metrics, which provide in-depth quota and usage data of indexes, documents, data sources, aliases, and much more. To add the Azure AI Search monitor, ...
    • 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 ...
    • API exceeded error

      Why do I get an API exceeded error after a few attempts? Every API has a certain limit to the number of requests a user can hit within a period of time, called the rate limit. An error message is triggered when a user does one of the following ...