GET All Saved Queries

GET Saved Query


Request used to list all Saved Queries

URL

https://REGION.rest.logs.insight.rapid7.com/query/saved_queries

REGION is the data center for your account - e.g. "us" or "eu"

Method

GET

Authentication

Owner, Read Write or Read Only key is required.

URL Params

None

Data Params

None

Success Response

Code 200Content:

json
1
{
2
"saved_queries": [
3
{saved query object 1},
4
{saved query object 2},
5
...,
6
{saved query object n}
7
]
8
}

Error Response

None

Sample Call

python
1
import requests
2
import json
3
import time
4
5
6
API_KEY = 'YOUR API KEY GOES HERE'
7
8
def handle_response(resp):
9
response = resp
10
time.sleep(1)
11
if response.status_code == 200:
12
print json.dumps(resp.json(), indent=4)
13
else:
14
print response.status_code
15
16
17
def make_request(provided_url=None):
18
headers = {'x-api-key': API_KEY}
19
20
url = "https://us.rest.logs.insight.rapid7.com/query/saved_queries"
21
req = requests.get(url, headers=headers)
22
return req
23
24
25
def print_query():
26
req = make_request()
27
handle_response(req)
28
29
def start():
30
print_query()
31
32
33
if __name__ == '__main__':
34
start()

Notes