Help accessing my application via Javascipt SDK


#1

Hi guys.
Just started writing a Javascript client for our application and I am experiencing some difficulties accessing the API.
I am trying to call my app which has a service in the DSP named, let’s say, “Test1”.
So I attempt to trigger it this way:

window.app.getTest1 = function () {
window.df.apis.Test1(function (response) {
});

What I see in Chrome’s debugger is: Uncaught TypeError: object is not a function
I guess he doesn’t recognise window.df.apis.Test1 as the correct path to my service?

Hope this makes sense…
Thanks in advance, Pavel


#2

Sorry, I meant this:

 window.app.getTest1 = function () {
    window.df.apis.Test1({table_name: "some_tabele"}, function (response) {
        //Do something with the data;
       document.getElementById("test-results").innerHTML = JSON.stringify(response);

    }, function(response) {
        document.getElementById("test-results").innerHTML = window.app.getErrorString(response);
    });
};

#3

Oh I found it:

window.df.apis.test1.getRecords({table_name: "table_name"}

Thanks, Pavel


#4

Pavel - so by the looks of it you were able to solve your own issue. Always puts a smile on my face when this sort of thing happens :smile:

Please feel free to reach out with anymore questions. We’re here to help.

Mark


#5

Help posting data with form,

Hello, please help me am new to dreamfactory i posted a question and
still haven`t gotten any response back yet. here is the link to my
question please.