cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
381
Views
0
Helpful
0
Replies

Umbrella API remove domain from list succeeds but doesnt remove domain

cdaawg565
Level 1
Level 1

I am using python to interact with this API: https://developer.cisco.com/docs/cloud-security/#!destinations-delete-destinations-from-destination-list

When I run my code, I get 200 success, BUT the domain I supposedly removed is still there when I look at the list, (either through the web portal or query it with the API https://developer.cisco.com/docs/cloud-security/#!get-destinations-in-destination-list)

If I tweak the way the 'remove_params' are set, I don't get a response 200, except for the other 'remove_params' you see commented out.

The result of 'print(remove_params)'

is: ['www.xxx.com']

Can someone please let me know what I'm doing wrong?

 

 

 

remove_url = f"https://api.umbrella.com/policies/v2/destinationlists/{list_id}/destinations/remove"
remove_headers = {"Authorization": f"Bearer {access_token}", "Content-Type": "application/json",  "Accept": "application/json"}    
remove_params = [principal_domain]
print(remove_params)
#remove_params = [f'{principal_domain}']
remove_response = requests.delete(remove_url, headers=remove_headers, json=remove_params)
print(f"Removal response: {remove_response.status_code}")
    if remove_response.status_code == 200:
        print("Removal success.")        
        print("######################")
    else:
        print("Removal failure.")
        print(json.dumps(remove_response.json()))
        exit()

 

 

 

 

 

 

 

 

 

0 Replies 0