This web service creates a new vocabulary.
| Method | Endpoint |
|---|---|
POST |
|
It is necessary to provide an Ft-Calling-App value when using Fluid Topics web services. See Fluid Topics calling app.
Request example
To create a vocabulary, the web service call requires a multipart/form-data request body where the different parts consist in:
- A configuration file, which must be named
vocabulary.json. - A CSV file, an RDF/SKOS file, or a DITA subject scheme map containing the terms of the vocabulary.
All formats have specific requirements. See Format requirements.
The following curl command is a call example:
curl -X POST \
--location 'https://my-fluidtopics.net/api/admin/khub/vocabularies' \
--header 'Authorization: Bearer $API-KEY' \
--header 'FT-Calling-App: XXXXX' \
--header 'Content-Type: multipart/form-data' \
--form 'new.csv=@"new.csv";type=text/csv' \
--form 'vocabulary.json=@"vocabulary.json";type=text/json'
Replace @"vocabulary.json" and @"new.csv" by the local path to the file.
Where the content of vocabulary.json is the following:
{
"id": "new-vocabulary",
"description": "a description of my new vocabulary",
"mimeType": "text/csv",
"usedInSearch": true
}
| Field | Type | Required? | Description |
|---|---|---|---|
id |
String | Yes | The vocabulary's unique identifier. The value for the id field cannot contain spaces, nor / or + characters. |
description |
String | Yes | The description of the vocabulary. It is only available in the List vocabularies web service response. |
mimeType |
String | Yes | Defines the format of the file containing the terms of the vocabulary. Possible values are text/csv for CSV vocabularies, application/rdf%2Bxml for RDF/SKOS vocabularies, and application/dita%2Bxml for DITA subject scheme maps. |
usedInSearch |
Boolean | Yes | Defines whether the search engines uses the vocabulary when indexing content. |
| Return code | Description |
|---|---|
201 CREATED |
The request is valid and data was returned. |
400 BAD REQUEST |
The request is invalid. |
401 UNAUTHORIZED |
The authorization header was not provided or is invalid. |
403 FORBIDDEN |
The user not have the ADMIN or KHUB_ADMIN role. |
For a list of all possible return codes, see Return codes.