Get the Content of an HTML Section - Fluid Topics - 3.6

Use Fluid Topics Web API

Product
Fluid Topics
FT_Version
3.6
Category
Technical Notes
language
English

This web service returns the HTML content of a "section."

A section can be:

  • a short structured publication (book or article, usually a knowledge-base-like entry)
  • a topic and all its children

Like the deep link web services, the Get an HTML Section web service performs a search using all the query parameters as filters, then takes the top result to define the returned section (either a map or a topic).

As in the HTML export, all cross-guide links are disabled. Also, internal links pointing outside of the section are disabled.

Method

Endpoint

GET

/api/khub/section/html?context_id=1234&filter_1=value_1&...&filter_n=value_n

Where:

  • context_id depends on the content type. For instance, it can be ait:code for Author-it content or dita:mapPath and dita:topicPath for DITA content.
  • filter is any metadata key-value couple that differentiates the section. Use as many metadata as needed to define unique content.

Example: http://myportal.fluidtopics.net/api/khub/section/html?ft:baseId=12345&version=3.0&docType=Reference%20Guide

To learn more about the way to use the metadata to filter content in the web service scope, consult our Deep Links to Official Content section.

Use Case

A common use case would be the inline-help scenario.

From a third-party integration, an integrator wants to point to HTML content already available in Fluid Topics, and display it in context to its end-users, for instance in a pop-up.

Return codes

Return Code

Description

200 OK

Returns text/html content.

400 BAD REQUEST

Invalid request.

404 NOT FOUND

The search yielded no results. No section was found matching the criteria.

Output

The web service returns text/html content.

Example

In the OD2000 Time Machine User Guide publication, the topic How to Time Travel has three topic children:

How to Time Travel
├── Set Local Date and Time
├── Set Destination Date and Time
└── Set a Destination Location

To retrieve the HTML content of the How to Time Travel topic in its Novice instance, the following request is used: "https://oleandor.fluidtopics.net/api/khub/section/html?dita:topicPath=how_to_time_travel.dita&dita:ditavalPath=Novice.ditaval".

It returns the following HTML content:

<section class="ft-section">
<div id="1SooKJEmtVO55uSVTWUYEQ" class="ft-topic">
<h1 class="ft-topic-title ft-toc-level-1">How to Time Travel</h1>
<article class="ft-topic-body">
<div class="content-locale-en-US content-locale-en">
<div id="how_to_time_travel">
<div class="body">
<p class="p">Before time traveling, it is important to know at what time point and zone time you want to travel to and for how much time...</p>
<br>
<div class="imagecenter">
<img class="image imagecenter" src="data:image/png;base64,...">
</div>
<br>

</div>
</div>
</div>
</article>
</div>
<div id="MyP3~w_nsPyBnjcZRLjDHA" class="ft-topic">
<h1 class="ft-topic-title ft-toc-level-2">Set Local Date and Time</h1>
<article class="ft-topic-body">
<div class="content-locale-en-US content-locale-en">
<div id="set_local_date_and_time">
<div class="body">
<p class="p">As a reference, it is crucial to set local date and time prior to setting destination date and time.</p>
<p class="p">In
<span class="ph menucascade">
<span class="ph uicontrol">Settings</span> &gt;
<span class="ph uicontrol">Date and Time</span> &gt;
<span class="ph uicontrol">Date</span>
</span>, set the current date in the following format:
<samp class="ph codeph">mm-dd-yyyy</samp>.
</p>
<p class="p">In
<span class="ph menucascade">
<span class="ph uicontrol">Settings</span> &gt;
<span class="ph uicontrol">Date and Time</span> &gt;
<span class="ph uicontrol">Time</span>
</span>, set the current local time in the following format:
<samp class="ph codeph">hh:mm</samp>.
</p>
</div>
</div>
</div>
</article>
</div>
<div id="EVi~_emWAIDHiD90WLzN0w" class="ft-topic">
<h1 class="ft-topic-title ft-toc-level-2">Set Destination Date and Time</h1>
<article class="ft-topic-body">
<div class="content-locale-en-US content-locale-en">
<div id="set_destination_date_and_time">
<div class="body">
<p class="p">To make sure you arrive in the desired date and time, set a destination <strong class="ph b">local</strong> date and time</p>
<p class="p">In
<span class="ph menucascade">
<span class="ph uicontrol">Settings</span> &gt;
<span class="ph uicontrol">Destination settings</span> &gt;
<span class="ph uicontrol">Date and Time</span> &gt;
<span class="ph uicontrol">Date</span>
</span>, set the arrrival date in the following format:
<samp class="ph codeph">mm-dd-yyyy</samp>.
</p>
<p class="p">In
<span class="ph menucascade">
<span class="ph uicontrol">Settings</span> &gt;
<span class="ph uicontrol">Destination settings</span> &gt;
<span class="ph uicontrol">Date and Time</span> &gt;
<span class="ph uicontrol">Time</span>
</span>, set the arrival local time in the following format:
<samp class="ph codeph">hh:mm</samp>.
</p>
</div>
</div>
</div>
</article>
</div>
<div id="J9c1O60yym0oe~ECOeXZAg" class="ft-topic">
<h1 class="ft-topic-title ft-toc-level-2">Set a Destination Location</h1>
<article class="ft-topic-body">
<div class="content-locale-en-US content-locale-en">
<div id="set_destination_location">
<div class="body">
<p class="p">To make sure you arrive in the desired place, set a destination location.</p>
<p class="p">In
<span class="ph menucascade">
<span class="ph uicontrol">Settings</span> &gt;
<span class="ph uicontrol">Destination settings</span> &gt;
<span class="ph uicontrol">Location</span>
</span>, enter the GPS coordinates of the chosen time travel location in the Degrees, minutes, and seconds (DMS) format.
</p>
<p class="p">Example: 41°24'12.2" N 2°10'26.5" E</p>
</div>
</div>
</div>
</article>
</div>
</section>