Get the content of an HTML section - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service returns the unstyled HTML content of an HTML section. An HTML section is a topic and its children topics, or a whole document. The response includes topic titles.

Method Endpoint
GET
/api/khub/section/html?$FILTER_1=value_1&...&$FILTER_N=value_n
Query string parameter Type Required? Description
FILTER_1 String Yes The format of this parameter is any metadata key-value pair that differentiates the topic from other topics.
FILTER_N String No Use as many metadata pairs as needed to target a unique topic. See Create deep links for examples of metadata pairs.

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.

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://example.fluidtopics.net/api/khub/section/html?dita:topicPath=how_to_time_travel.dita&dita:ditavalPath=Novice.ditaval

To learn more about how to use metadata to filter content in the web service's scope, see Deep links.

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>

Fluid Topics does not render cross-document links and internal links pointing outside of the topic in the response.

With internal links, it is possible to recreate them using the value found in the data-ft-warning attribute. For example:

data-ft-warning="topic-not-found-in-current-book OvnjFy2KyFixbvNyopwbSA"

In this case, OvnjFy2KyFixbvNyopwbSA is the tocId of the topic. It is possible to use the tocId of a topic to access it by using the following link format:

Portal URL + /r/ + the ft:publicationId value of the document + / + ft:tocId value of the topic

With cross-document links, it is possible to recreate them using the data-clusterid value as part of a deep link.

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.