GET Tag

GET Tag


Request used to get a specific Tag

URL

https://REGION.rest.logs.insight.rapid7.com/management/tags/:tagid

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

tagid=[UUID] Example Value: de305d54-75b4-431b-adb2-eb6b9e546014

Data Params

None

Success Response

Code 200Content:

json
1
{
2
"tag": {
3
"type": "Alert",
4
"id": "de305d54-75b4-431b-adb2-eb6b9e546014",
5
"name": "Power Button Pressed",
6
"sources": [],
7
"actions": [
8
{
9
"id": "de305d54-75b4-431b-adb2-eb6b9e546014",
10
"min_matches_count": 1,
11
"min_report_count": 1,
12
"min_matches_period": "Day",
13
"min_report_period": "Day",
14
"targets": [
15
{
16
"id": null,
17
"type": "Mailto",
18
"params_set": {
19
"direct": "user@example.com",
20
"teams": "",
21
"users": "user@example.com"
22
},
23
"alert_content_set": {}
24
}
25
],
26
"enabled": false,
27
"type": "Alert"
28
}
29
],
30
"patterns": [
31
"Power Button as"
32
],
33
"labels": [
34
{
35
"id": "de305d54-75b4-431b-adb2-eb6b9e546014",
36
"sn": 1056,
37
"name": "Power Button",
38
"color": "007afb",
39
"reserved": false
40
}
41
]
42
}
43
}

Error Response

If the Tag can not be found Code 404 NOT FOUND

Sample Call

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

Notes