Forum Discussion
EdmondNader
Aug 18, 2023Copper Contributor
AddOrRemoveTagForMultipleMachines api limitation when machine id doesn't exist
Dears, I have noticed when using the Defender for endpoint api for AddOrRemoveTagForMultipleMachines that the whole task fails to add/remove tag if one of the device IDs array is inactive or not ...
jbmartin6
Aug 18, 2023Iron Contributor
Pull the list of all your devices using the devices API and then check that all your device IDs are valid before submitting a request to AddOrRemoveTagForMultipleMachines
- EdmondNaderAug 18, 2023Copper ContributorThank for your suggestion
I was thinking of the same but pulling all our device IDs take long time and reach the count limit if we are using the List machines API, so this will encounter in more API calls
the main aim of using the bulk tagging instead of individual API call is do reduce the overall API calls for the needed- jbmartin6Aug 18, 2023Iron ContributorJust getting the list of all machines is just one request. It only takes a few seconds for our 3000 machines. Just using the 'machines' API with no filter returns all machines, though it was a page limit of 10k so if you have more than that you would use one API call per page. Should still be well within the limit. You can use a oData query in the API request to only get machines in an Active state or any other way you want to narrow the results down.
- EdmondNaderAug 18, 2023Copper Contributor
Thank you for your response
The challenge we are facing with getting machines using API is due to higher number of machines 70k+
It can be a valid workaround that I can give it another try, I was just hopping of there is a was for the bulk tagging API to just discard the non existing/inactive IDs
Thanks