ezeio2:apiref:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ezeio2:apiref:start [2022-08-11 16:35] – [Version 1 API] andrehezeio2:apiref:start [2022-08-11 17:17] (current) – [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, CURLOPT_URL, APIURI."/".implode("/", $params));     curl_setopt($ch, CURLOPT_URL, APIURI."/".implode("/", $params));
Line 82: Line 82:
 </code> </code>
  
-Below is a minimal example using Python+Below is a minimal example fetching current status using Python
  
 <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 # Just used to format the output
  
 # API credentials from eze.io -> Groups Settings -> Manage API Keys # API credentials from eze.io -> Groups Settings -> Manage API Keys
Line 99: Line 99:
 r = requests.get(apiurl, auth=HTTPDigestAuth(apikeyid, apikey)) r = requests.get(apiurl, auth=HTTPDigestAuth(apikeyid, apikey))
  
-# Convert response to a data object+# Convert response to a dictionary
 data = r.json() data = r.json()
  
-# Dump the whole object to screen+# Dump whole dictionary to screen
 pprint(data) pprint(data)
 +
 +# Print the value of field 1
 +print(data['fields']['1']['value'])
 </code> </code>
  • ezeio2/apiref/start.1660235715.txt.gz
  • Last modified: 2022-08-11 16:35
  • by andreh