How to record with a server side script?


I wanted to know how to record datas with a server side script, because I don’t want to write my tables and fields names in my client side javascript code. Actualy to insert data for example, I do :

//Insert a record = function(){
    var item = {"record":[
        window.df.apis.myService.createRecords({"table_name":"my_table_name", "body":item}, function (response) {
            document.getElementById("post-results").innerHTML = JSON.stringify(response);
        }, function(response) {
           document.getElementById("get-results").innerHTML =;

So my question is : How can I do it on the server, and then how can I call this from the client ?
Thank you very much,

You should be able to accomplish this easily with server-side scripting. For example, create a custom script named addThing, then invoke the script from your client by calling POST /rest/system/script/addThing.

The script should be written to call"db/my_table_name", item), for example.

Here is the relevant documentation page:

And a quick tutorial:

Hi Jeff

Following from this say I want to add userID and dateCreated to data being posted from the client - how would I do that ?