Page 1 of 1

Need to send a file for an API endpoint and use the response

PostPosted: Thu Mar 18, 2021 9:39 am
by martinewski
Hello fellow Hazlers!

I need to send a file to an OCR API endpoint which will process it and send me a response which I'll use to rename the file.

I know how to do it in cURL, but apparently Hazel can't use shell scripts' response later. Am I right? Do you have any suggestions on how to do it in another way?

Re: Need to send a file for an API endpoint and use the resp

PostPosted: Thu Mar 18, 2021 10:17 am
by Mr_Noodle
Not sure what you mean. You can have a shellscript use curl and return a proper success or failure based on the response.

Re: Need to send a file for an API endpoint and use the resp

PostPosted: Thu Mar 18, 2021 11:03 am
by martinewski
What I need is the response content (JSON), not only a success/failure.

Re: Need to send a file for an API endpoint and use the resp

PostPosted: Fri Mar 19, 2021 10:02 am
by Mr_Noodle
You need to send the whole JSON back to Hazel? What would Hazel do with it after that?