Retrieving All Application Pages by API - How?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
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?
Photo of Ryan

Ryan

  • 170 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,462 Points 20k badge 2x thumb
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.


(Edited)
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
I have to ask.... 
Why?