Hazel initiates script for REST API calls?

What’s the best way to use Hazel to execute a block of code for making REST API calls (specially the Google Photos API)? I am am a novice at these sorts of scripts, but understand I could use AppleScript to run a curl command for making the API call (and assigning the result of the calls to AppleScript variables). Or could I use Hazel to execute a Java program and pass the matched file path to it? Any other suggestions on how to do this?