DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
""" Threat Grid - who am I """
import requests
url =
"https://panacea.threatgrid.com/api/v3/session/whoami"
querystring =
{"api_key":"deadbeefelcpgib9ec0909"}
headers = {
'cache-control': "no-cache",
}
response = requests.request(
"GET",
url,
headers=headers,
params=querystring
)
print(response.text)

Example 11-19 shows the JSON response to the request
in Example 11-18.


Example 11-19 Threat Grid Response

Click here to view code image


{
"api_version": 3,
"id": 1234567,
"data": {
"role": "user",
"properties": {},
"integration_id": "z1ci",
"email": "[email protected]",
"organization_id": 666777,
"name": "devasc",
"login": "devasc",
"title": "DevNet Associate",
"api_key": " deadbeefelcpgib9ec0909",
"device": false
}
}

The Data, Sample, and IOC APIs


The Data API allows developers to search observables by
specific criteria. You can do an entity search by using the
/search/ endpoint. You can pivot the Threat Grid data by

Free download pdf