We provide some web interface example for app which run under allgo. Most of them are using the javascript framework jQuery, but the choice of the techno is yours. You can access the code of this demo. If you make a specific interface for your app, but you don't have any server to host it : Send us a Dockerfile (like in the examples) We suggest to host your interface, because you'll have less restrictions.
A small jQuery function to launch a job on allgo :
$("#form").on("submit", function(event) { //the formData embed an uploaded file and the webapp id formData = new FormData($(this)[0]); $.ajax({ type: 'POST', url: 'https://allgo.inria.fr/api/v1/jobs', data: formData, cache: false, contentType: false, processData: false, headers: { 'Authorization': 'Token token=your token, 'Accept':'application/json' }, success: function(d, s, ex) { console.log("success"); console.log(d); } }) return false; });
A small php snippet, sending a file by url :
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://allgo.inria.fr/api/v1/jobs"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-type: multipart/form-data','Authorization: Token token=c00eefecd3834fd4acdd0df45c4bb88e')); $fields = array('webapp_id'=>"122",'file_url'=>"https://upload.wikimedia.org/wikipedia/en/5/5f/Original_Doge_meme.jpg"); //url-ify the data for the POST $fields_string = http_build_query(array('job' => $fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); print "running the request..."; $server_output = curl_exec ($ch); curl_close ($ch); print $server_output