Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ezeio2:apiref:start [2022-08-11 16:35] – [Version 1 API] andreh | ezeio2:apiref:start [2024-09-05 21:50] (current) – andreh | ||
---|---|---|---|
Line 11: | Line 11: | ||
All API calls require authentication using Digest Auth (RFC 2617). The API ID number shall be used as the Digest Auth Username, and the API key shall be used as the Password. | All API calls require authentication using Digest Auth (RFC 2617). The API ID number shall be used as the Digest Auth Username, and the API key shall be used as the Password. | ||
+ | |||
+ | Alternatively, | ||
All API calls require HTTPS using TLS v1.2 or TLS v1.3. Calls via unencrypted HTTP are not allowed. | All API calls require HTTPS using TLS v1.2 or TLS v1.3. Calls via unencrypted HTTP are not allowed. | ||
Line 56: | Line 58: | ||
); | ); | ||
- | // Request a websocket key and metadata using cURL | + | // Set up cURL |
$ch = curl_init(); | $ch = curl_init(); | ||
curl_setopt($ch, | curl_setopt($ch, | ||
Line 82: | Line 84: | ||
</ | </ | ||
- | Below is a minimal example using Python | + | Below is a minimal example |
<code python ezeioAPIexample.py> | <code python ezeioAPIexample.py> | ||
import requests | import requests | ||
from requests.auth import HTTPDigestAuth | from requests.auth import HTTPDigestAuth | ||
- | from pprint import pprint | + | from pprint import pprint |
# API credentials from eze.io -> Groups Settings -> Manage API Keys | # API credentials from eze.io -> Groups Settings -> Manage API Keys | ||
Line 99: | Line 101: | ||
r = requests.get(apiurl, | r = requests.get(apiurl, | ||
- | # Convert response to a data object | + | # Convert response to a dictionary |
data = r.json() | data = r.json() | ||
- | # Dump the whole object | + | # Dump whole dictionary |
pprint(data) | pprint(data) | ||
+ | |||
+ | # Print the value of field 1 | ||
+ | print(data[' | ||
</ | </ |