Get a Topic's Content - Fluid Topics - 3.6 - Technical Notes

Integrate Fluid Topics APIs

Product
Fluid Topics
Fluid Topics Version
3.6
Category
Technical Notes
Language
English
Target Audience
public

It is possible to retrieve the content of topics within a map using the Get a Topic's Content web service:

/api/khub/maps/$MAP_ID/topics/$CONTENT_ID/content

Where:

  • /maps lists all maps stored on the Fluid Topics server.
  • /$MAP_ID retrieves metadata for a specific map. The map ID is given with /maps.
  • /topics lists all topics within the given map.
  • /$CONTENT_ID retrieves the title and metadata of a specific topic. The content ID is given with /topics.
  • /content retrieves the content – title excluded – of the given topic in TEXT/HTML format.

Clustering is not available for this web service.

After listing the topics, it is possible to use endpoints to go deeper into the topics and retrieve more information.

For example, after getting the title of the topic Introduction to Time Machines, using the Get a Topic's Content web service returns the following additional information for this topic:

<div class="content-locale-en-US content-locale-en">
<div id="intro_to_time_machines">
<div class="body">
<p class="p">Time travel has always been one of the biggest dreams of mankind! Our time machines
allow you to travel in time easily and safely.</p>
</div>
</div>
</div>

The following lines show an example of a Python implementation of the Get a Topic's Content web service:

#!/usr/bin/env python3
import requests
FT_SERVER_URL = 'https:// <host>/<serviceId>/<status>/'

#
MAPS_ENDPOINT = '/api/khub/maps'

#
HEADERS = {'FT-Authorization': 'Basic ...'}

#
def crawl_maps():
URL = FT_SERVER_URL + MAPS_ENDPOINT
...

#
def crawl_map(map_preview):
URL = FT_SERVER_URL + map_preview['mapApiEndpoint']
...

#
def crawl_map_topics(map_details):
URL = FT_SERVER_URL + map_details['topicsApiEndpoint']
...

#
def crawl_map_topic(topic_preview):
URL = FT_SERVER_URL + topic_preview['contentApiEndpoint']
...