| Toll Free: 1 877 4 0 SHRINK |
English Arabic Spanish

Devices SDK

ZeroShrink Devices SDK - API TJS offers a Software Development Kit for developers that are interested in integrating Device Manager into their applications. The Kit includes the application programming interface (API) and developer documentation, along with code samples to help developers get started quickly.

Developers can choose from either a .NET or REST Web Services API implementation. Each has different programming, packaging and runtime characteristics that gives developers flexibility based on the target application's requirements. The .NET implementation is ideal for Windows applications since it allows for natively linking the Device Manager library into the target application. The REST implementation is more suitable for non-Windows applications or those applications that desire a more loosely coupled integration. The REST implementation runs as a stand-alone web server process and includes end-user features for device configuration, management and troubleshooting. It is distributed via the web using the Java WebStart framework so installation and updates are handled automatically.

Requirements:

• Web Services API is a Java WebStart application which requires the Java 1.7+ runtime
• .NET API requires Microsoft .NET Framework 4.0+


REST Web Services

// Start scanning
curl -X POST --data "_action=connectAndStart" http://localhost:9000/devices/2B40E200/action

// Read the scanned tags synchronously 
curl -X GET http://localhost:9000/devices/2B40E200/payloads

// Stop scanning
curl -X POST --data "_action=stopAndDisconnect" http://localhost:9000/devices/2B40E200/action

Use our REST Web Services API implementation with your web and cloud based applications. Code samples included in our SDK will help you integrate into your existing framework quickly. Requires Java 1.7+ runtime library.

REQUEST SDK


JAVA

// Here’s an example to read scanned tags from a device synchronously     
try {
   String serialNumber = "2B40E200";  

   DeviceManager.connect(serialNumber);
			
     // get the scanned tags and display each tag ID
     for (String tag : DeviceManager.executeCommand(serialNumber).getPayload())
          System.out.print("tag : " + tag);
			
   DeviceManager.disconnect(serialNumber);
	
     } catch (Exception ex) {
          ex.printStackTrace();
     }

Sample JAVA code for reading device tags is shown to the right. Code samples included in our SDK will help you develop your needed features with little effort.

REQUEST SDK


C#

// Here’s an example to read scanned tags from a device asynchronously
class AsyncTest
{
    public static void Test()
 {
     string serialNumber = "2B40E200";
         
     // Register callback to be notified when device has new data
     DeviceManager.DeviceDataReceived += new   
         DeviceManager.DeviceDataReceiveHandler(DeviceDataReceived);
         
     // Start the asynchronous process to get data from the device in the background
     DeviceManager.StartDevice(serialNumber);
         
     // Keep reading until user presses Enter
     Console.ReadLine();
         
     // Stop the asynchronous process and disconnect the device
     DeviceManager.StopDevice(serialNumber);
  }
     
 // This is the callback that is notified when the device has new data
 public static void DeviceDataReceived(string source, DeviceDataEventArgs e)
     {
         if (e.Response.Data.Count > 0)
         {
             foreach (object data in e.Response.Data)
             {
                 if (data.GetType() == typeof(Tag))
                 {
                     string tag = ((Tag)data).Uid;
                     Console.WriteLine(source + " :: Tag " + ((Tag)data).Uid);
                 }                  
             }
         }
     }
 }

Developing Windows applications? We offer a .NET implementation in our SDK specifically designed for that purpose. Sample C# code pictured to the right demonstrates a function to read device tags asynchronously. Developer documentation and code samples illustrating key features allow simple implementation into your current Windows applications.

REQUEST SDK