Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP POST

POST knowledge_base/catalogs

Ostatnia modyfikacja 2026-05-18 13:56:05
Tworzy nowy katalog bazy wiedzy.

URL

https://your-system-name.thulium.com/api/knowledge_base/catalogs

Parametry

name

wymagany

Nazwa katalogu.
language

wymagany

Język katalogu (pl, en, de).

Przykładowy request

POST https://your-system-name.thulium.com/api/knowledge_base/catalogs
Dane { "name": "Support Catalog", "language": "en" }

Przykładowy response

{
  "id": "8df31cdd-822d-4b13-9b23-155b5cd6ca7c",
  "name": "Support Catalog",
  "language": "en",
  "cover": null
}

Przykładowe wywołanie


PHP
<?php
$data = '{ "name": "Support Catalog", "language": "en" }';

$request = curl_init('https://your-system-name.thulium.com/api/knowledge_base/catalogs');
curl_setopt($request, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json; charset=utf-8',
    'Content-Length: ' . mb_strlen($data)
));
curl_setopt($request, CURLOPT_USERPWD, 'api_user:api_pass');
curl_setopt($request, CURLOPT_TIMEOUT, 30);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($request, CURLOPT_POSTFIELDS, $data);

$response = curl_exec($request);
if ($response) {
    $httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);
    if ($httpCode == 200){
        print_r(json_decode($response));
    } else {
        echo $response;
    }
} else {
    trigger_error(curl_error($request), E_USER_WARNING);
}

curl_close($request);
JAVA
public class Example {
    public static void main(String[] args) throws Exception {
        ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);

        ThuliumRestClient.ThuliumRestResponse response = restClient.post("https://your-system-name.thulium.com/api/knowledge_base/catalogs", "{ \"name\": \"Support Catalog\", \"language\": \"en\" }");
        System.out.println(response);
    }
}

CURL
curl -u api_user:api_pass -k -X POST -H "Content-type: application/json" -d '{ "name": "Support Catalog", "language": "en" }' "https://your-system-name.thulium.com/api/knowledge_base/catalogs"

HTTPie
echo '{ "name": "Support Catalog", "language": "en" }' | http -a api_user:api_pass POST https://your-system-name.thulium.com/api/knowledge_base/catalogs