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
Last revisionBoth sides next revision
ezeio2:apiref:start [2022-07-15 19:55] andrehezeio2: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, CURLOPT_URL, APIURI."/".implode("/", $params));     curl_setopt($ch, CURLOPT_URL, APIURI."/".implode("/", $params));
Line 80: Line 80:
     // Show what we received     // Show what we received
     print_r($json);     print_r($json);
 +</code>
 +
 +Below is a minimal example 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 = '00000'
 +apikey = '12345abcde12345abcde12345abcdeff'
 +
 +# API endpoint and request - see doc.eze.io
 +apiurl = 'https://api.eze.io/v1/status/ABC000'
 +
 +# Send request
 +r = requests.get(apiurl, auth=HTTPDigestAuth(apikeyid, apikey))
 +
 +# Convert response to a dictionary
 +data = r.json()
 +
 +# Dump whole dictionary to screen
 +pprint(data)
 +
 +# Print the value of field 1
 +print(data['fields']['1']['value'])
 </code> </code>
  • ezeio2/apiref/start.txt
  • Last modified: 2022-08-11 17:17
  • by andreh