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 [2021-11-15 21:33] – 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 27: | Line 29: | ||
=== Available API functions === | === Available API functions === | ||
{{indexmenu> | {{indexmenu> | ||
+ | |||
+ | === API fair use === | ||
+ | The API functionality is a shared resource, and as such requires 'good behavior' | ||
+ | |||
+ | The API also implements flood control counters to limit excessive calls as follows; | ||
+ | * Per 60 seconds : 100 API calls per key | ||
+ | * Per 24 hours : 50000 API calls per key | ||
+ | If these limits are exceeded, an error is returned. The counters are automatically reset at the end of the interval. | ||
=== Example code === | === Example code === | ||
- | <code php> | + | This example shows how to call the " |
+ | |||
+ | < | ||
<?php | <?php | ||
define(" | define(" | ||
Line 46: | 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 70: | Line 82: | ||
// Show what we received | // Show what we received | ||
print_r($json); | print_r($json); | ||
+ | </ | ||
+ | |||
+ | Below is a minimal example fetching current status using Python | ||
+ | |||
+ | <code python ezeioAPIexample.py> | ||
+ | import requests | ||
+ | from requests.auth import HTTPDigestAuth | ||
+ | from pprint import pprint # Just used to format the output | ||
+ | |||
+ | # API credentials from eze.io -> Groups Settings -> Manage API Keys | ||
+ | apikeyid = ' | ||
+ | apikey = ' | ||
+ | |||
+ | # API endpoint and request - see doc.eze.io | ||
+ | apiurl = ' | ||
+ | |||
+ | # Send request | ||
+ | r = requests.get(apiurl, | ||
+ | |||
+ | # Convert response to a dictionary | ||
+ | data = r.json() | ||
+ | |||
+ | # Dump whole dictionary to screen | ||
+ | pprint(data) | ||
+ | |||
+ | # Print the value of field 1 | ||
+ | print(data[' | ||
</ | </ |