Get a topic's styled content - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service returns the HTML content of a given topic with its original styling.

  • Cross-document links and internal links pointing outside of the topic are disabled in the response.
  • The topic's children are not included in the response.
Method Endpoint
GET /api/khub/topic/styled-content?$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.
Return code Description
200 OK Returns text/html content.
400 BAD REQUEST Invalid request.
401 UNAUTHORIZED The authorization header is absent or invalid.
404 NOT FOUND No topic matching the filters configured in the path parameters was found.

Example

An integrator wants to take HTML content available on a Fluid Topics portal, and display it to end-users in an inline help window.

The integrator has chosen to target the How to Time Travel topic. This topic belongs to the OD2000 Time Machine User Guide publication, and its structure is as follows:

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 integrator sends the following request to the web service:

https://oleandor.fluidtopics.net/api/khub/topic/styled-content?dita:topicPath=how_to_time_travel.dita&dita:ditavalPath=Novice.ditaval

In its response, the web service returns the following HTML content:

<!doctype html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>I am the first part of the article</title>
        <link href="http://oleandor.fluidtopics.net/stylesheets/customizations.css?v=f02cb8db" rel="stylesheet">
    </head>
    <body>
        <section class="title">
            <div class="content-locale-en-US content-locale-en depth-1" lang="en-US">
                <h1>I am the first part of the article</h1>
            </div>
        </section>
        <section class="topic">
            <div class="content-locale-en-US content-locale-en depth-1">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla molestie pellentesque porta.
            Sed accumsan turpis eget condimentum auctor. Number aliquam tempor blandit.
            Maecenas eu euismod nunc. Quisque posuere vitae nulla vel blandit.
            Sed mattis eros eget tincidunt gravida.
            Vestibulum tincidunt, metus non facilisis fermentum, enim nunc commodo lorem.
            Vel dapibus sapien nulla sit amet eros. 
            Donec ultricies non metus at ullamcorper. Nulla imperdiet consectetur molestie.
            </div>
        </section>
    </body>
</html>

When displayed in the UI, the HTML content is styled.