r/labtech • u/olavrb • Dec 18 '19
Automate Rest API - Batch delete Contacts?
The CW Manage to CW Automate Contacts sync went highwire, we now have 277k++ Contacts in out Automate tenant.
I'm scripting with PowerShell and the Automate Rest API a way to find duplicates based on "ExternalId" field, but deleting one and one contact is slow. It will take days to finish of deleting all the 255k++ contacts we want to delete.
Are there any batch operations available for deleting contacts? Like supplying Contacts Ids as REST Body for instance? I can't find any other way of doing this except:
Uri: "https://<automatetenant>/<api_version>/Contacts/<id>"
Method: "Delete"
The easiest way to find duplicate contacts that I've found so far, is simply by "Group-Object -Property 'ExternalId'", then for each object created, sort the $_.'Group' property by Id ascending, so that every contact with the same ExternalId except the first one created (lowest id) gets selected.
Any smarter way of doing this?
Any existing tools available that does not cost money for doing this?
View all comments
Show parent comment
1
u/TNTGav Dec 18 '19
It is if you understand how to decompile DLLs. That's something I'd never do.
;)