I’m trying to start a zone via the API. Below is the command I’m running… sanitized for privacy.
curl -X PUT -H “Content-Type: application/json” -H “Authorization: Bearer AUTH-KEY-HERE” -d ‘{“id” : “XXXX-ZONE-ID-HERE”, “duration” : 60}’ https://api.rach.io/1/public/zone/start
The Zone ID I am using is the Zone ID I retrieved when running the below command, and pulling the “id” within the zones JSON response.
curl -X GET -H “Content-Type: application/json” -H “Authorization: Bearer XXXX-AUTH ID” https://api.rach.io/1/public/device/XXXX-DEVICeID
C:\Users\me>curl -X PUT -H “Content-Type: application/json” -H “Authorization: Bearer XXXX-AUTH-ID” -d ‘{ “id” : “XXXX-ZONE-ID”, “duration” : 60 }’ https://api.rach.io/1/public/zone/start
curl: (6) Could not resolve host: id
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: XXXX-ZONE-ID,
curl: (6) Could not resolve host: duration
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 60
curl: (3) [globbing] unmatched close brace/bracket in column 1
{“code”:“301”,“error”:“field name id required. Error message is Unexpected End Of File position 2: null”}
I’m assuming i’m formatting it wrong, but i’m not sure what’s wrong. Any assistance would be greatly appreciated.