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 ...
    • 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 ...
    • Steps to partially update monitor settings in bulk using API

      Monitor details like notification profiles, threshold and availability can be changed/updated in bulk using API without affecting the existing configuration settings. Use Case: A user wants to change only the notification profile of a monitor without ...
    • 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 ...
    • Understanding latency in data center operations

      Latency, measured in milliseconds (ms), is the time taken for a response to be generated by an application or service. Lower latency results in quicker responses. Latency can occur due to several factors like: Network traffic: High volumes can slow ...