Application Guide

MSNTN02: Controlling the EzOutlet3
Page 7
4. REST API
Basic functions of the ezOutlet3 can be controlled through a series of HTTP Packet Requests.
Examples in this section are shown using cURL for Windows. Any software capable of sending and processing
HTTP packets can be used.
Turn Outlet On/Off
HTTP Packet Request
"GET" <target> "HTTP/1.1"CRLF
"Host:" <host ip>CRLF
"Keep-Alive: 300"CRLF
"Connection: keep-alive"CRLF
"Authorization:Base" <auth>CRLFCRLF ;auth:encoded account(admin:1234) with base-64
HTTP URL: “http://< IP>/cgi-bin/control.cgi?<auth>&<action>”
Request Description:
IP:
The IP Address of the ezOutlet3
Auth:
user=<Web Account>
passwd=<Web Password>
Action:
target=<0/1>;
0 means outlet mode,
1 means outlet
control=<0/1/2/3>;
0 means off,
1 means on,
2 means switch (i.e. from On → Off, or from Off → On),
3 means reset (Outlet only)
Packet Response:
XML format:
"<?xml version='1.0'?>"
"<request>"
“<outlet_status>”{outlet_status}”</outlet_status>
"<outlet_mode>”{outlet_mode}”</outlet_mode>”
"</request>"
XML Description:
outlet_status: 0 = off, 1 = on
outlet_mode: 0 = manual control, 1 = auto reset