Upload content - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service allows users to upload content to a Fluid Topics portal, through a source.

After the upload, users can monitor the publish job using the Get a publish report web service.

  • Users or API keys with the CONTENT_PUBLISHER role can only upload content through a source they have permission for.
  • The size of the content to upload must not exceed 1.85 GB.
  • The size of individual topics to upload must not exceed 100 MB.
  • It is not possible to upload content on a consumer portal.
Method Endpoint
POST
/api/admin/khub/sources/{sourceId}/upload?publisher=name
Path parameter Type Description
{sourceId} String The identifier of the source as obtained when listing available sources.
The source must correspond to the content's format (an FTML source for FTML content, a DITA source for DITA content, etc.)
Query string parameter Type Required? Description
publisher String No Requires the use of an API key. A name that appears under the User column in the History table of the Publishing menu of the Knowledge Hub. If not set, it is the name of the API key.
The value of the publisher parameter must be a UTF-8 URL-encoded string.

It is necessary to provide an Ft-Calling-App value when using Fluid Topics web services. See Fluid Topics calling app.

Example

To upload content, the web service call requires a multipart/form-data request body, like in the following curl command:

curl --request POST \
     --form "file=@$MY_ARCHIVE.ZIP" \
     --header "Authorization: Bearer $API_KEY" \
     https://my-fluidtopics.net/api/admin/khub/sources/{sourceId}/upload?publisher=Jane%20Doe

The server automatically updates the ZIP file and adds information about the source.

Response body

{
  "started": true,
  "jobId": 1,
  "uploadId": "d441085c-4209-45ce-ab5f-37998b059730",
  "uuid": "9246b42a-bcea-4991-adeb-9cd2b696b97e",
  "reportApiEndpoint": "http://docs.fluidtopics.com/api/khub/uploads/d441085c-4209-45ce-ab5f-37998b059730/report"
}

The link in the reportApiEndpoint field grants access to the publish report as described in Get a publish report.

Return code Endpoint
200 OK The content has been uploaded.
401 UNAUTHORIZED The credentials are invalid.
403 FORBIDDEN The user or API key does not have the CONTENT_PUBLISHER or ADMIN role.
404 NOT FOUND The source does not exist, or the CONTENT_PUBLISHER user or API key does not have the appropriate rights to use this source.