Load UI page HTML via server side

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2017 06:24 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2017 10:10 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2017 01:31 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2017 01:39 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2019 05:38 AM
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