Example 11-5 Response to the GET Request to List
Domains Using the Enforcement API
Click here to view code image
{
"meta":{
"page":1,
"limit":200,
"prev":false,
"next":"https://s-
platform.api.opendns.com/1.0/
domains?customerKey=XXXXXXX-YYYY-ZZZZ-
YYYY-XXXXXXXXXXXX&page=2&limit=200"
},
"data":[
{
"id":1,
"name":"baddomain1.com"
},
{
"id":2,
"name":"looksfake.com"
},
{
"id":3,
"name":"malware.dom"
}
]
}
The final part of the Enforcement API is the DELETE
call to delete the domain API. The API helps in
unblocking domains that were blocked because of
previously injected events. Example 11-6 shows an
example of a simple Python requests command to
delete a domain using the Enforcement API. The URL to
do this is as follows:
Click here to view code image
https://s-
platform.api.opendns.com/1.0/domains/looksfake.
com?customerKey= XXXXXXX-YYYY-ZZZZ-YYYY-
XXXXXXXXXXXX