Skip to content

HTML Snippet API Response

jrochkind edited this page Jan 4, 2012 · 5 revisions

While Umlaut has a full XML/JSON Data API Response, for the common use case of embedding Umlaut content on an external page, it's just too much work to use the full data api.

This HTML Snippet API Response is meant for when you want Umlaut to generate the HTML, but you want to embed that HTML on an external page. The API will deliver sections of generated HTML, that you can include elsewhere.

If you plan to include it via javascript, you will likely find it even more convenient and less work to use the Umlaut JQuery Content Utility, saving you even more work. The Content Utility javascript helper uses the API behind the scenes.

Accessing the API

Supplied via the resolve/partial_html_sections actions. Instead of accessing the ordinary resolver base URL, you replace resolve? in your query with resolve/partial_html, eg http://umlaut.university.edu/resolve/partial_html? . You send the OpenURL context object the same as you would for an ordinary resolve action, in URL or POST XML, etc.

By default, the API returns XML. To return json instead, include:

&umlaut.response_format=json

To return jsonp, wrapped in a javascript procedure call:

&umlaut.response_format=jsonp&umlaut.jsonp=desiredJavascriptFunctionName
Clone this wiki locally