How would I adapt this script to an AppleScript?

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.

Thanks so much Nigel, as it works like a charm. I simply didn’t know how to format it.

Thanks again!
Chuck