How To: Use the sample Rest API clientEnterMedia provides a simple Rest API for external systems to interact with it. This API also allows developers to create their own User Interface (UI). To demonstrate how to use EnterMedia's REST API, we've developed a sample terminal client in Java. This way developers can easily start a new EnterMedia client project. DownloadingThe sample java client is distributed as a zip file. You can get this file directly from our website. The file includes:
BuildingThe bundle comes with an Ant build file so you can just run it to build the client. If you are not using ant, you can just use plain javac to compile the classes in the src folder, passing in all the jar files in the lib directory into the classpath. RunningThe most basic way of running the sample client is by just invoking the Java virtual machine, passing along the right arguments. That is, telling it that the classpath contains all the jar files in the lib directory and that the main method is in the com.entermedia.ui.ConsoleClient class. This should look like: A better way of running it is using ant: Finally, an even easier way of running the client in linux is using the included javaclient.sh script: For more information about the arguments for the client please look at the readme.html file inside the docs folder, in the zip file. |