It would be a good idea to make sure $id is an int before passing it to call_integration_hook and the query. Even though it's not likely that it won't be an int, you're better safe than sorry.