JS Get data from bubble example

Hi,

I’m building a Cordova app that will get the data from my Bubble.io App. Despite I can find a phyton example on a script to read data from the database, I can’t find any example of out to make it with JS. Can someone please help me? Just the basic principles of connect to API and receive the json obj.

Sorry if this topic is somewhere else but i’ve been searching and don’t find anything.

Thanks a lot
Martim

You can just make a normal web request to the Data API exposed by the bubble app.
Or to the backend workflow public API endpoint.

Thank you so much for your reply. I’ve figure out doing like this:

    $.getJSON('mybubbleapp/version-test/api/1.1/obj/users', function(data) {
        
        var items = [];
          $.each( data, function( key, val ) {
            items.push( "<li id='" + key + "'>" + val + "</li>" );
          });
         
          $( "<ul/>", {
            "class": "my-new-list",
            html: items.join( "" )
          }).appendTo( "body" );
        console.log(data)
    });

Now I’m only getting a Object.object output, but probably I’m doing something wrong :wink:

Why not just return the keys and values to a state inside bubble using the JS to Bubble utility? This way you can have access to all the keys and the values inside of bubble and you can display them however you want.

EDIT: Just read that you needed a solution for Cordova, ignore the js to bubble part :grimacing: