Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
ezeio2:apiref:start [2022-08-11 16:34] – andreh | ezeio2:apiref:start [2022-08-11 17:14] – [Version 1 API] andreh | ||
---|---|---|---|
Line 56: | Line 56: | ||
); | ); | ||
- | // Request a websocket key and metadata using cURL | + | // Set up cURL |
$ch = curl_init(); | $ch = curl_init(); | ||
curl_setopt($ch, | curl_setopt($ch, | ||
Line 87: | Line 87: | ||
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 | ||
- | apikeyid = '99999' | + | apikeyid = '00000' |
- | apikey = '11122233344455556666777888999999' | + | apikey = '12345abcde12345abcde12345abcdeff' |
# API endpoint and request - see doc.eze.io | # API endpoint and request - see doc.eze.io | ||
- | apiurl = ' | + | apiurl = ' |
# Send request | # Send request | ||
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[' | ||
</ | </ |