hub.eb?material_id=30

External API


To use Verj as a back-end service for any front-end page, you just need to include one javascript library served by your Verj server.

On the server you must have a form which provides the functionality you want via the Client API. Then, on the front end page, call startForm with the name of your form and the location of your Verj server.

$eb.startForm(null, null, "ebExternalAPI", "http://147.75.97.163:3030/ebase");

Now you can call Client API functions such as $eb.executeFunction() to get and set data from the server.

For more information check out the documentation.

For instructions on how to use our demo, see the Instructions tab.

Steps


1

To use this demo, you can simply include the html below in the head of your application and call the functions however you like.

You'll need to write your own function to handle the data returned by the server. The structure of this data is visible in the demo above.

<!-- The location of our demo server and the remote api javascript file on it -->
<script src="http://147.75.97.163:3030/ebase/javascript/xiRemoteApi511.js"> // Xi remote API library</script>
  
<script>
  // set up connection to Xi app
  $eb.startForm(null, null, "ebExternalAPI", "http://147.75.97.163:3030/ebase");

  // get all medals
  function getAllMedals() {$eb.executeFunctionAsynchronously(writeData, error, "getMedals", null);}
  
  // the following functions take a string value and search for data containing that string
  // get medals by athlete name
  function getMedalsByName(value) {$eb.executeFunctionAsynchronously(writeData, error, "getMedalsByName", value);}
  
  // get medals by medal
  function getMedalsByMedal(value) {$eb.executeFunctionAsynchronously(writeData, error, "getMedalsByMedal", value);}
  
  // get medals by discipline
  function getMedalsByDiscipline(value) {$eb.executeFunctionAsynchronously(writeData, error, "getMedalsByDiscipline", value);}
  
  // get medals by event
  function getMedalsByEvent(value) {$eb.executeFunctionAsynchronously(writeData, error, "getMedalsByEvent", value);}
  

  var writeData = function(data) {
	// Your data handling function here
  }
  
  var error = function(errMsg) {
	// Your error handling function here
  }
  
</script>

Video

Related