Sure. I'm using it in combination with Ajax on the client side. To call the scripts I'm using something like this:
declare some variable, for example (but you can use different names):
var AP = put your application key here, you can find it after you created yours under Apps;
var UT =put your session token here, it's provided when your user logged in; there are way where your user doesn't need to login;
var var1 = some variable;
var var2 = some other variable;
$.ajax({
type: 'POST',
beforeSend: function(request) {
request.setRequestHeader('X-DreamFactory-Api-Key', AP);
request.setRequestHeader('X-DreamFactory-Session-Token', UT);
},
url: '//177.77.88.88/api/v2/*name of your script*?n1=' + var1 + '&n2=' + var2,
//dataType: "JSON", //use this if you want JSON back
dataType: "TEXT", //use this if you want text / string back
contentType: "JSON",
success: function(response) {
console.log(response);
},
error: function(xhr, ajaxOptions, thrownError) {
console.log(thrownError);
console.log(ajaxOptions);
}
});
If you want to call a script or db service within the the custom script you would use platform.api.post, for example something like this:
var adddata = platform.api.post("mysql/_table/Pictures", {"resource": [{"Picture_addedby" : username, "Picture_date" : dformat, "Picture_number" : picturename, "Picture_width" : width, "Picture_height" : height}]});
Also make sure that under roles you give access to a user to use the script API side (meaning the first example) or on the server side (SCRIPT) and what types you want to use. So for example if you want a user to call your script from a webpage, you would allow POST + API.
Hope it helps.