Quick Base Discussions

Expand all | Collapse all

Retrieving All Application Pages by API - How?

  • 1.  Retrieving All Application Pages by API - How?

    Posted 10-20-2017 15:08
    Looking for an API or figuring out a process by APIs to grab all the pages in an application (especially the code pages).  I've used the API_GetSchema to grab the application level and table levels. The table schema seems to have everything I need in it, but the application schema is very bare. 

    I didn't realize the pages were excluded from the schema pull of the application.  I see there is an API call for getting a specific page, API_GetDBPage, but that works only if you know the page ids beforehand

    Is there an API that will show all the pages ids for an application, or get all pages?


  • 2.  RE: Retrieving All Application Pages by API - How?

    Top
    Contributor
    Posted 10-20-2017 15:46
    Just make you own API. On the page ?a=AppDBPages there is a global variable QuickBase uses for the Model named input.modelData. Just load this page into a hidden <iframe> and when it fully loads reach into the <iframe> and grab this global variable:
    var url = "https://SUBDOMAIN.quickbase.com/db/APPDBID?a=AppDBPages";
    $("body").append($('<iframe id="QBU_iframe" style="display:none"></iframe>'));
    $("#QBU_iframe").attr("src", url);
    $("#QBU_iframe").load(function () {
      var pages = document.getElementById("QBU_iframe").contentWindow.input.modelData;
      console.log(JSON.stringify(pages, null, "  "));
    });
    You will get pages as an object with this structure:
    [{
        "name": "secret.html",
        "type": "Text",
        "id": 6,
        "specific": ""
      },
      {
        "name": "module.js",
        "type": "Text",
        "id": 7,
        "specific": ""
      }
    ]

    Don't be hemmed in by the official API. The internet is your API plaything.




  • 3.  RE: Retrieving All Application Pages by API - How?

    Top
    Contributor
    Posted 10-20-2017 17:35
    I have to ask.... 
    Why?