ahwman
October 28, 2018, 2:01am
#1
Hello,
I’m trying to adapt the following curl command to an AppleScript without success. Any help would, be greatly appreciated…
curl https://api.notifymyecho.com/v1/NotifyMe -H “Content-Type: application/json” -d ‘{“notification”:“Hello World!”,“accessCode”:“ACCESS_CODE”}’
Hi.
Assuming the command works in terminal, the Applescript version of it would be:
do shell script "curl https://api.notifymyecho.com/v1/NotifyMe -H \"Content-Type: application/json\" -d '{\"notification\":\"Hello World!\",\"accessCode\":\"ACCESS_CODE\"}'"
When I try running this, the result is the text “{"error":"Unauthorized","message":"ACCESS_CODE is not a valid accessCode"}” , which suggests that the server at the other end at least understands the request.
ahwman
October 28, 2018, 2:04pm
#3
Thanks so much Nigel, as it works like a charm. I simply didn’t know how to format it.
Thanks again!
Chuck