Loading...
 
Skip to main content

History: Api Categories Doc

Source of version: 1 (current)

Copy to clipboard
{DIV(class="content-section d-none" id="get-categories")}
!!! Get all categories

{TABS(name="doc-get-categories" tabs="Request URL| cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - categories" colors="http" theme="default")}https://example.com/api/categories{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - categories" colors="http" theme="default")}
curl -X 'GET' \
  'https://example.com/api/categories?parentId=1&descends=1&type=all' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer xxxxx'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - categories" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/categories?' . http_build_query([
    'parentId' => 1,
    'descends' => 1,
    'type' => 'all'
]);

$headers = [
  'Accept: application/json',
  'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if (curl_errno($ch)) {
      $error_msg = curl_error($ch);
      echo 'Error: ' . $error_msg;
} else {
      $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
      if ($http_code === 200) {
          $data = json_decode($response, true);
          print_r($data);
      } else {
          echo 'Error: HTTP status code ' . $http_code;
      }
}
curl_close($ch);
?>
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - categories" colors="http" theme="default")}
    const params = new URLSearchParams({
      parentId: '1',
      descends: '1',
      type: 'all'
    });
    fetch('https://example.com/api/categories?' + params.toString(), {
        method: 'GET',
        headers: {
          'Accept': 'application/json',
          'Authorization': 'Bearer xxxxx'
        }
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
        console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - categories" colors="http" theme="default")}
{
  "1": {
    "categId": 1,
    "name": "Super Admin",
    "description": "",
    "parentId": 0,
    "rootId": 0,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [
      2,
      3
    ],
    "descendants": [
      2,
      3,
      4,
      5,
      6,
      7
    ],
    "tepath": {
      "1": "Super Admin"
    },
    "categpath": "Super Admin",
    "relativePathString": "Super Admin"
  },
  "2": {
    "categId": 2,
    "name": "Contributers",
    "description": "",
    "parentId": 1,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [
      6,
      7
    ],
    "descendants": [
      6,
      7
    ],
    "tepath": {
      "1": "Super Admin",
      "2": "Contributers"
    },
    "categpath": "Super Admin::Contributers",
    "relativePathString": "Super Admin::Contributers"
  },
  "3": {
    "categId": 3,
    "name": "Translators",
    "description": "",
    "parentId": 1,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [
      4,
      5
    ],
    "descendants": [
      4,
      5
    ],
    "tepath": {
      "1": "Super Admin",
      "3": "Translators"
    },
    "categpath": "Super Admin::Translators",
    "relativePathString": "Super Admin::Translators"
  },
  "4": {
    "categId": 4,
    "name": "French Translators",
    "description": "",
    "parentId": 3,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [],
    "descendants": [],
    "tepath": {
      "1": "Super Admin",
      "3": "Translators",
      "4": "French Translators"
    },
    "categpath": "Super Admin::Translators::French Translators",
    "relativePathString": "Super Admin::Translators::French Translators"
  },
  "5": {
    "categId": 5,
    "name": "Chinese Translators",
    "description": "",
    "parentId": 3,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [],
    "descendants": [],
    "tepath": {
      "1": "Super Admin",
      "3": "Translators",
      "5": "Chinese Translators"
    },
    "categpath": "Super Admin::Translators::Chinese Translators",
    "relativePathString": "Super Admin::Translators::Chinese Translators"
  },
  "6": {
    "categId": 6,
    "name": "Developers",
    "description": "",
    "parentId": 2,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [],
    "descendants": [],
    "tepath": {
      "1": "Super Admin",
      "2": "Contributers",
      "6": "Developers"
    },
    "categpath": "Super Admin::Contributers::Developers",
    "relativePathString": "Super Admin::Contributers::Developers"
  },
  "7": {
    "categId": 7,
    "name": "DevOps",
    "description": "",
    "parentId": 2,
    "rootId": 1,
    "hits": 0,
    "tplGroupContainerId": 0,
    "tplGroupPattern": null,
    "num_roles": 0,
    "objects": 0,
    "children": [],
    "descendants": [],
    "tepath": {
      "1": "Super Admin",
      "2": "Contributers",
      "7": "DevOps"
    },
    "categpath": "Super Admin::Contributers::DevOps",
    "relativePathString": "Super Admin::Contributers::DevOps"
  }
}
{CODE}
{DIV}

{TABS}

!!! Parameters

* __parentId__ ''integer'' ''Optional'': The ID of the parent category to return children or descendants of.

* __ descends__ ''integer'' ''Optional'': Return descendants of a category. Possible values are:
** ~~#9011ff:__0__~~: Return children of a category
** ~~#9011ff:__1__~~: Return descendants of a category

* __type__ ''string'' ''Optional'': Possible values are
** ~~#9011ff:__roots__~~: return root level categories
** ~~#9011ff:__all__~~: return all categories
** everything else return descendants of a category

{DIV}



{DIV(class="content-section d-none" id="create-category")}
!!! Create a new category

{TABS(name="doc-create-category" tabs="Request URL | cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - category" colors="http" theme="default")}https://example.com/api/categories{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - category" colors="http" theme="default")}
curl -X 'POST' \
  'https://example.com/api/categories' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization: Bearer xxxxx' \
  -d 'parentId=1&name=test%20category&description=description&parentPerms=true'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - category" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/categories';

$data = http_build_query([
    'parentId' => 1,
    'name' => 'test category',
    'description' => 'description',
    'parentPerms' => true
]);

$headers = [
    'Accept: application/json',
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

$response = curl_exec($ch);

if (curl_errno($ch)) {
  $error_msg = curl_error($ch);
  echo 'Error: ' . $error_msg;
} else {
  $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
   if ($http_code === 200) {
       $data = json_decode($response, true);
       print_r($data);
   } else {
       echo 'Error: HTTP status code ' . $http_code;
   }
}
curl_close($ch);
?>
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - category" colors="http" theme="default")}
const formData = new URLSearchParams({
      parentId: '1',
      name: 'test category',
      description: 'description',
      parentPerms: true
    });
    fetch('https://example.com/api/categories', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/x-www-form-urlencoded',
          'Authorization': 'Bearer xxxxx'
        },
        body: formData.toString()
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
         console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - category" colors="http" theme="default")}
{
  "categId": 11,
  "name": "test category",
  "description": "description",
  "parentId": 1,
  "rootId": 1,
  "hits": 0,
  "tplGroupContainerId": 0,
  "tplGroupPattern": "",
  "num_roles": 0,
  "objects": 0,
  "children": [],
  "descendants": [],
  "tepath": {
    "1": "Super Admin",
    "11": "test category"
  },
  "categpath": "Super Admin::test category",
  "relativePathString": "Super Admin::test category"
}
{CODE}
{DIV}

{TABS}

!!!! Parameters

* __parentId__ ''integer'' ''Optional'': The ID of the parent category

* __name__ ''string'' ~~#fe0000:*~~: The name of the category

* __description__ ''string'' ''Optional'': The description of the category

* __tplGroupContainerId__ ''integer'' ''Optional'': The ID of the template group container

* __tplGroupPattern__ ''string'' ''Optional'': The template group pattern
** ~~#9011ff:__true__~~: Copy parent category permissions
** ~~#9011ff:__false__~~:  Do not copy parent category permissions

{DIV}


{DIV(class="content-section d-none" id="update-category")}
!!! Update a category

{TABS(name="doc-update-category" tabs="Request URL | cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - category" colors="http" theme="default")}https://example.com/api/categories/{categId}{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - category" colors="http" theme="default")}
curl -X 'POST' \
  'https://example.com/api/categories/11' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization: Bearer xxxxx' \
  -d 'parentId=1&name=test%20category%20updated&description=description%20updated&parentPerms=true'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - category" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/categories/11';

$data = http_build_query([
    'parentId' => 1,
    'name' => 'test category updated',
    'description' => 'description updated',
    'parentPerms' => true
]);

$headers = [
    'Accept: application/json',
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

$response = curl_exec($ch);

if (curl_errno($ch)) {
  $error_msg = curl_error($ch);
  echo 'Error: ' . $error_msg;
} else {
  $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
   if ($http_code === 200) {
       $data = json_decode($response, true);
       print_r($data);
   } else {
       echo 'Error: HTTP status code ' . $http_code;
   }
}
curl_close($ch);
?>
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - category" colors="http" theme="default")}
const formData = new URLSearchParams({
      parentId: '1',
      name: 'test category updated',
      description: 'description updated',
      parentPerms: true
    });
    fetch('https://example.com/api/categories/11', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/x-www-form-urlencoded',
          'Authorization': 'Bearer xxxxx'
        },
        body: formData.toString()
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
         console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - category" colors="http" theme="default")}
{
  "categId": 11,
  "name": "test category updated",
  "description": "description updated",
  "parentId": 1,
  "rootId": 1,
  "hits": 0,
  "tplGroupContainerId": 0,
  "tplGroupPattern": "",
  "num_roles": 0,
  "objects": 0,
  "children": [],
  "descendants": [],
  "tepath": {
    "1": "Super Admin",
    "11": "test category updated"
  },
  "categpath": "Super Admin::test category updated",
  "relativePathString": "Super Admin::test category updated"
}
{CODE}
{DIV}

{TABS}

!!!! Parameters

* __parentId__ ''integer'' ''Optional'': The ID of the parent category

* __name__ ''string'' ~~#fe0000:*~~: The name of the category

* __description__ ''string'' ''Optional'': The description of the category

* __tplGroupContainerId__ ''integer'' ''Optional'': The ID of the template group container

* __tplGroupPattern__ ''string'' ''Optional'': The template group pattern
** ~~#9011ff:__true__~~: Copy parent category permissions
** ~~#9011ff:__false__~~:  Do not copy parent category permissions

{DIV}


{DIV(class="content-section d-none" id="delete-category")}
!!! Delete a category

{TABS(name="doc-delete-category" tabs="Request URL | cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - category" colors="http" theme="default")}https://example.com/api/categories/{categId}{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - category" colors="http" theme="default")}
curl -X 'DELETE' \
  'https://example.com/api/categories/11' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer xxxxx'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - category" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/categories/11';

$headers = [
    'Accept: application/json',
    'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if (curl_errno($ch)) {
  $error_msg = curl_error($ch);
  echo 'Error: ' . $error_msg;
} else {
  $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
   if ($http_code === 200) {
       $data = json_decode($response, true);
       print_r($data);
   } else {
       echo 'Error: HTTP status code ' . $http_code;
   }
}
curl_close($ch);
?>
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - category" colors="http" theme="default")}
    fetch('https://example.com/api/categories/11', {
        method: 'DELETE',
        headers: {
          'Accept': 'application/json',
          'Authorization': 'Bearer xxxxx'
        }
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
        console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - category" colors="http" theme="default")}
{
  "categId": 11,
  "name": "test category updated",
  "description": "description updated",
  "parentId": 1,
  "rootId": 1,
  "hits": 0,
  "tplGroupContainerId": 0,
  "tplGroupPattern": "",
  "num_roles": 0,
  "objects": 0,
  "children": [],
  "descendants": [],
  "tepath": {
    "1": "Super Admin",
    "11": "test category updated"
  },
  "categpath": "Super Admin::test category updated",
  "relativePathString": "Super Admin::test category updated"
}
{CODE}
{DIV}

{TABS}

!!!! Parameters

* __categId__ ''string'' ~~#fe0000:*~~: The category ID to be deleted

{DIV}


{DIV(class="content-section d-none" id="categorize")}
!!! Categorize

Categorize one or more objects under a specific category

{TABS(name="doc-categorize" tabs="Request URL | cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - categorize" colors="http" theme="default")}https://example.com/api/categorize{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - categorize" colors="http" theme="default")}
curl -X 'POST' \
  'https://example.com/api/categorize' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization: Bearer xxxxx' \
  -d 'categId=1&objects[]=wiki page:quiz' \
  -d 'categId=1&objects[]=file gallery:1' \
  -d 'categId=1&objects[]=trackeritem:1003'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - categorize" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/categorize';

$data = [
    ['categId' => 1, 'objects[]' => 'wiki page:quiz'],
    ['categId' => 1, 'objects[]' => 'file gallery:1'],
    ['categId' => 1, 'objects[]' => 'trackeritem:1003']
];

$postFields = [];
foreach ($data as $pair) {
  foreach ($pair as $key => $value) {
      $postFields[] = urlencode($key) . '=' . urlencode($value);
  }
}

$body = implode('&', $postFields);

$headers = [
    'Accept: application/json',
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$response = curl_exec($ch);

if (curl_errno($ch)) {
  $error_msg = curl_error($ch);
  echo 'Error: ' . $error_msg;
} else {
  $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  if ($http_code === 200) {
      $data = json_decode($response, true);
      print_r($data);
  } else {
      echo 'Error: HTTP status code ' . $http_code;
  }
}
curl_close($ch);
?>

{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - categorize" colors="http" theme="default")}
    const formData = new URLSearchParams();
    formData.append('categId', '1');
    formData.append('objects[]', 'wiki page:quiz');
    formData.append('categId', '1');
    formData.append('objects[]', 'file gallery:1');
    formData.append('categId', '1');
    formData.append('objects[]', 'trackeritem:1003');

    fetch('https://example.com/api/categorize', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/x-www-form-urlencoded',
          'Authorization': 'Bearer xxxxx'
        },
        body: formData.toString()
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
        console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - categorize" colors="http" theme="default")}
{
  "categId": 1,
  "count": 3,
  "objects": [
    {
      "type": "wiki page",
      "id": "quiz",
      "catObjectId": 3
    },
    {
      "type": "file gallery",
      "id": "1",
      "catObjectId": 4
    },
    {
      "type": "trackeritem",
      "id": "1003",
      "catObjectId": 5
    }
  ]
}
{CODE}
{DIV}

{TABS}

!!!! Request body

* __categId__ ''integer'' ~~#fe0000:*~~: The ID of the category to categorize the objects under

* __objects[]__ ''array'' ~~#fe0000:*~~: Tiki object use format Type:ID where type is trackeritem, page, etc. and ID is the object identifier based on type. 
** eg. ~~#9011ff:__trackeritem:1__~~,  ~~#9011ff:__wiki page:homePage__~~,  ~~#9011ff:__file:3__~~,  ~~#9011ff:__blog:4__~~, ~~#9011ff:__forum:5__~~, ~~#9011ff:__file gallery:6__~~, ~~#9011ff:__quiz:7__~~,  ~~#9011ff:__poll:8__~~,  ~~#9011ff:__calendar:9__~~, ~~#9011ff:__tracker:10__~~

{DIV}



{DIV(class="content-section d-none" id="uncategorize")}
!!! Uncategorize

Uncategorize one or more objects from a specific category

{TABS(name="doc-uncategorize" tabs="Request URL | cURL | PHP | JavaScript | Response" toggle="y" inside_pretty="n")}
{DIV()}
{CODE(caption="Request URL - uncategorize" colors="http" theme="default")}https://example.com/api/uncategorize{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="cURL - uncategorize" colors="http" theme="default")}
curl -X 'POST' \
  'https://example.com/api/uncategorize' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Authorization: Bearer xxxxx' \
  -d 'categId=1&objects[]=wiki page:quiz' \
  -d 'categId=1&objects[]=file gallery:1' \
  -d 'categId=1&objects[]=trackeritem:1003'
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="PHP - uncategorize" colors="http" theme="default")}
<?php
$url = 'https://example.com/api/uncategorize';

$data = [
    ['categId' => 1, 'objects[]' => 'wiki page:quiz'],
    ['categId' => 1, 'objects[]' => 'file gallery:1'],
    ['categId' => 1, 'objects[]' => 'trackeritem:1003']
];

$postFields = [];
foreach ($data as $pair) {
  foreach ($pair as $key => $value) {
      $postFields[] = urlencode($key) . '=' . urlencode($value);
  }
}

$body = implode('&', $postFields);

$headers = [
    'Accept: application/json',
    'Content-Type: application/x-www-form-urlencoded',
    'Authorization: Bearer xxxxx'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

$response = curl_exec($ch);

if (curl_errno($ch)) {
  $error_msg = curl_error($ch);
  echo 'Error: ' . $error_msg;
} else {
  $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  if ($http_code === 200) {
      $data = json_decode($response, true);
      print_r($data);
  } else {
      echo 'Error: HTTP status code ' . $http_code;
  }
}
curl_close($ch);
?>

{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Javascript - uncategorize" colors="http" theme="default")}
    const formData = new URLSearchParams();
    formData.append('categId', '1');
    formData.append('objects[]', 'wiki page:quiz');
    formData.append('categId', '1');
    formData.append('objects[]', 'file gallery:1');
    formData.append('categId', '1');
    formData.append('objects[]', 'trackeritem:1003');

    fetch('https://example.com/api/uncategorize', {
        method: 'POST',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/x-www-form-urlencoded',
          'Authorization': 'Bearer xxxxx'
        },
        body: formData.toString()
      })
      .then(res => {
        if (!res.ok) throw new Error("HTTP " + res.status);
        return res.json();
      })
      .then(data => {
        console.log(data);
      })
      .catch(err => {
        console.log('Fetch error: ' + err.message);
      });
{CODE}
{DIV}

/////
{DIV()}
{CODE(caption="Response - uncategorize" colors="http" theme="default")}
{
  "categId": "1",
  "count": 0,
  "objects": [
    {
      "type": "wiki page",
      "id": "quiz",
      "catObjectId": 3
    },
    {
      "type": "file gallery",
      "id": "1",
      "catObjectId": 4
    },
    {
      "type": "trackeritem",
      "id": "1003",
      "catObjectId": 5
    }
  ]
}
{CODE}
{DIV}

{TABS}

!!!! Request body

* __categId__ ''integer'' ~~#fe0000:*~~: The ID of the category to categorize the objects under

* __objects[]__ ''array'' ~~#fe0000:*~~: Tiki object use format Type:ID where type is trackeritem, page, etc. and ID is the object identifier based on type. 
** eg. ~~#9011ff:__trackeritem:1__~~,  ~~#9011ff:__wiki page:homePage__~~,  ~~#9011ff:__file:3__~~,  ~~#9011ff:__blog:4__~~, ~~#9011ff:__forum:5__~~, ~~#9011ff:__file gallery:6__~~, ~~#9011ff:__quiz:7__~~,  ~~#9011ff:__poll:8__~~,  ~~#9011ff:__calendar:9__~~, ~~#9011ff:__tracker:10__~~

{DIV}
Show PHP error messages