Load UI page HTML via server side

jeremy_gardner
Tera Expert

Hello,

We're trying to load a UI page and consume the HTML content from server-side code - is this possible?   Was considering doing it with REST but the only two REST interfaces I know so far are Table API and Custom REST, neither of which can be used on a UI page.

Any thoughts?   Javascript libraries we can use?

Thanks!

Jeremy

13 REPLIES 13

Hi Jeremy,


You need to use headless browser ( phantomjs , jasmine ) or WebClient api to do that job.  


Recently chrome has released headless browser. Using Nodejs you can play with it.




Getting Started with Headless Chrome   |   Web   |   Google Developers



Thanks


-YLN


Thanks for all the input.   However, I'm not sure that all aligns with what I'm seeing.   I can do a REST GET call against other public sites without authentication (www.espn.com, for example) and obtain their HTML, so it seems more related to the authentication against SN UI pages than limitation of the server-side.



We've tried using a local SN account and adding X-UserToken to the header, but still getting unauthorized.   Will try on a public UI page next, but wondering if there's another way.



Thanks!


Jeremy


Yep, if we make the UI page public then we can get the HTML via a REST GET call.   So anybody have any insight on authenticating against a UI page?



Thanks!


Jeremy


Community Alums
Not applicable

Hey all,

Take a look at how surveys have been set up. ServiceNow loads the HTML via server-side using script include call and all HTML is on widget dependencies. 

Thank you,
Rafael