Pantheon Community

API to index Pantheon hosted site from ServiceNow

Hi Folks,

We have a basic knowledge article site hosted on Pantheon. Its just a folder structure with .html and .css files, so no Wordpress or advanced underpinnings. We author the site elsewhere and FTP it up to the Pantheon servers.

What I need to do is to be able to index the knowledge articles on the site with ServiceNow so I can make them searchable and link directly to the correct article from the ServiceNow search results (ServiceNow is the support portal my company uses). To build the index I would need an API on Pantheon that we can query via REST to be able to gather all the article content and the URL it came from.

I don’t think we have any API functionality available to us, but I could be wrong. Looking for some info and a pointer in the right direction if possible.

Cheers

Hi,

Any API for this would normally be provided by your CMS, or custom code that you wrote. We don’t provide an api that would let you access the files outside of just reading them over HTTP.

So there are a couple of options. You could script something in combination with Terminus and RSync to gather all the files and send them to ServiceNow as an index. You could also write a script that plugs into their API and intergrates your content that way (though at that point I’d recommend re-building your docs into a CMS so you can have robust REST API support for them).

Most folks I know doing something similar with static content on the platform are indexing their content for external services during the build process. So with Gatsby and other static site generators, there are steps that will index the content to an external search provider like Agolia, and if you’re not going the CMS route here, something like that is what I’d recommend.

Without advanced underpinnings like a WordPress or Drupal CMS, it would seem building/using a REST API for this task might be a bit of overkill.

The simplest way to accomplish your integration goal would be to generate a sitemap.xml file or RSS feed for ServiceNow to consume, and FTP it up to Pantheon servers along with your content. There are third-party services that can help you generate a sitemap, or you could generate one manually (although a service would be much easier). If you have submitted your html files to Google for indexing, you may already have one. I believe ServiceNow has the ability to import XML files, so this would be an easy option.

You’d have to re-generate the sitemap.xml file every time content is added/removed/updated, so doing that manually won’t be much fun if your html changes frequently (which is one reason folks use WordPress and Drupal :slight_smile: ).

Hope that’s helpful. Good luck!

2 Likes

A sitemap is a great idea. Thank you. Our IT folks are going to investigate this as a first approach that might be fairly simple to implement and get us that route to surface content in ServiceNow. Moving to Wordpress would be a bigger piece of work which we would have to map out and determine if its part of the longer term strategy for this website. Still, I’m a lot further ahead than I was last week as we now have more options on the short-list!

2 Likes