ezeio2:apiref:subscribe

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
Next revisionBoth sides next revision
ezeio2:apiref:subscribe [2021-01-27 00:07] andrehezeio2:apiref:subscribe [2021-01-27 22:22] andreh
Line 1: Line 1:
 ==== subscribe ==== ==== subscribe ====
  
-Request a websocket data stream, and commands to manage the data stream+Request a websocket data stream, and commands to manage the data stream.
  
 === Description === === Description ===
Line 115: Line 115:
 With an open websocket and while receiving data from the ezeio system, you can call the subscribe API to request immediate updates or to cancel updates from a certain ezeio. With an open websocket and while receiving data from the ezeio system, you can call the subscribe API to request immediate updates or to cancel updates from a certain ezeio.
  
-To request fast updates, the call is: +To request unbuffered log updates, the call is: 
-<code>https://api.eze.io/v1/subscribe/wstktXXXXXXXXXXXXXXXXXXXXXXX/!ABC123</code>+<code>https://api.eze.io/v1/subscribe/wstktXXXXXXXXXXXXXXXXXXXXXXX/ABC123</code> 
 +The log updates will revert to normal (buffered) mode after 30 minutes.
  
 To cancel updates, the call is: To cancel updates, the call is:
Line 122: Line 123:
  
 Multiple requests can be sent in the same command: Multiple requests can be sent in the same command:
-<code>https://api.eze.io/v1/subscribe/wstktXXXXXXXXXXXXXXXXXXXXXXX/-ABC123,!ABC124,!ABC321,-ABC322</code> +<code>https://api.eze.io/v1/subscribe/wstktXXXXXXXXXXXXXXXXXXXXXXX/-ABC123,ABC124,ABC321,-ABC322</code> 
 +Up to 50 devices can be included in the same command
  
 === Example code (PHP) === === Example code (PHP) ===
-<code>+<code php>
 <?php <?php
     define("APIURI", "https://api.eze.io/v1/subscribe/ticket");     define("APIURI", "https://api.eze.io/v1/subscribe/ticket");
          
     // API keyID and key needs to be set up in eze.io under Groups->API.     // API keyID and key needs to be set up in eze.io under Groups->API.
-    define("APIKeyID", "10009"); +    define("APIKeyID", "12345"); 
-    define("APIKey", "4167f958727d4e358a6dfadf23c90a8f");+    define("APIKey", "XXXXXYYYYYXXXXXYYYYYXXXXXYYYYY");
  
     // Using the textalk/websocket client     // Using the textalk/websocket client
 +    // https://github.com/Textalk/websocket-php
     require('vendor/autoload.php');     require('vendor/autoload.php');
     use WebSocket\Client;     use WebSocket\Client;
  
-    // Request a websocket key using cURL+    // Request a websocket key and metadata using cURL
     $ch = curl_init();     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, APIURI);     curl_setopt($ch, CURLOPT_URL, APIURI);
  • ezeio2/apiref/subscribe.txt
  • Last modified: 2021-01-28 23:49
  • by andreh