Code: Select all
curl -d "username=[username]&password=[password]&stateful=1" -c /tmp/zmcookies.txt https://serverdomain.com/zm/api/host/login.json
curl -b /tmp/zmcookies.txt https://serverdomain.com/zm/api/monitors/alarm/id:20/command:on.json
curl -b /tmp/zmcookies.txt https://serverdomain.com/zm/api/monitors/alarm/id:20/command:off.json
curl -b /tmp/zmcookies.txt https://serverdomain.com/zm/api/host/logout.json
Code: Select all
{"access_token":"[long string of text]","access_token_expires":7200,"refresh_token":"[long string of text]","refresh_token_expires":86400,"credentials":"auth="[string of text]","append_password":0,"version":"1.34.22","apiversion":"2.0"}
{"status":""}
{"status":""}
{"result":"ok"}