Inconsistency in file delete and file load API method


#1

Hello!

we are trying to delete files using full-delete api call (https://developers.hubspot.com/docs/methods/files/hard_delete_file_and_associated_objects). The API call returns string false as if file is not deleted. But when we try to load the file by id we receive null, as if the file does not exist.

It seems that it would be better for full-delete api call to either return 404 Not Found in this case or return true (i.e. file doesn’t exist). Otherwise we need to implement file delete with an additional API call to check does file exist or not whenever full-delete responded with false (i.e. we don’t know if file already doesn’t exist or delete failed for some reason).

Thanks!


#2

Hi @Anton_Litvinenko,

Thank you for the feedback. I’ve touched base with product for some more clarity on this. I’ll reach out here when I have some more information.


#3

Hi @Anton_Litvinenko,

Just wanted to give you a quick update. Product has an update for this that isn’t yet in production. Once it is, you can expect to get a 404 response when the file in question can’t be found. I’ll reach back out here once the update is live.


#4

Hi @Anton_Litvinenko,

This should now be updated in production; you’ll now see a 404 error when trying to delete a file that doesn’t exist.


#5

@Derek_Gervais Thanks! that was fast!