Skip to content

ManualChapters

Introduction

ManualChapters are a collection of ManualChapterEntries and describe structure and permissions for Manual contents.

Model & Relations

Namespace

Modules\Manual\Entities\ManualChapter

Relations

RelationKeyTypeRelation Field(s)
DepartmentsdepartmentsBelongs to manyIntermediate table
ManualChapterEntriesentriesHas manymanual_chapter_entries.chapter_id

Traits

  • Sortable

List

Get a list of all ManualChapters the current authenticated User is allowed to view.

Definition

GET /api/manual/chapters

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/manual/chapters', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response Body

json
[
  {
    "id": 1,
    "icon_id": 20,
    "name": "Chapter 1",
    "slug": "chapter-1",
    "sort_number": 1,
    "created_at": "2019-01-24 14:07:25",
    "updated_at": "2019-01-24 14:07:25"
  },
  {
    "id": 2,
    "icon_id": 20,
    "name": "Chapter 2",
    "slug": "chapter-2",
    "sort_number": 2,
    "created_at": "2019-01-24 14:08:02",
    "updated_at": "2019-01-24 14:08:02"
  }
]

Get

Get a single ManualChapter by id.

Definition

GET /api/manual/chapters/{id}

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/manual/chapters/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response Body

json
{
  "id": 1,
  "icon_id": 20,
  "name": "Chapter 1",
  "slug": "chapter-1",
  "sort_number": 1,
  "created_at": "2019-01-24 14:08:02",
  "updated_at": "2019-01-24 14:08:02"
}

[Adm.] List

Get a list of all ManualChapters.

Definition

GET /api/administration/manual/chapters

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/manual/chapters', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response Body

json
[
  {
    "id": 1,
    "icon_id": 20,
    "name": "Chapter 1",
    "slug": "chapter-1",
    "sort_number": 1,
    "created_at": "2019-01-24 14:07:25",
    "updated_at": "2019-01-24 14:07:25"
  },
  {
    "id": 2,
    "icon_id": 20,
    "name": "Chapter 2",
    "slug": "chapter-2",
    "sort_number": 2,
    "created_at": "2019-01-24 14:08:02",
    "updated_at": "2019-01-24 14:08:02"
  }
]

[Adm.] Get

Get a single ManualChapter by id.

Definition

GET /api/administration/manual/chapters/{id}

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/administration/manual/chapters/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response Body

json
{
  "id": 1,
  "icon_id": 20,
  "name": "Chapter 1",
  "slug": "chapter-1",
  "sort_number": 1,
  "created_at": "2019-01-24 14:08:02",
  "updated_at": "2019-01-24 14:08:02"
}

[Adm.] Create

Create a new ManualChapter.

Definition

POST /api/administration/manual/chapters

Request Keys

KeyTypeDefaultDescription
icon_idinteger20The Icon of the ManualChapterk
name*string-The name of the ManualChapter (unique by all ManualChapters)
slugstringSlugged nameThe slugged name of the ManualChapter (unique by all ManualChapters)
sort_numberintegerCurrent highest +1The index of the ManualChapter
department_idsstring-The Departments that are allowed to see the ManualChapter (seperated by comma). When empty, the ManualChapter will be public

Keys with * are required.

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/administration/manual/chapters', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'name' => 'Chapter 3',
        'department_ids' => '2,3'
    ]
]);

Example Response Body

json
{
  "status": "success",
  "data": {
    "name": "Chapter 3",
    "icon_id": 20,
    "slug": "chapter-3",
    "sort_number": 3,
    "updated_at": "2019-01-25 15:13:21",
    "created_at": "2019-01-25 15:13:21",
    "id": 3
  }
}

[Adm.] Update

Update an existing ManualChapter by id.

Definition

PUT /api/administration/manual/chapters/{id}

Request Keys

KeyTypeDescription
icon_idintegerThe Icon of the ManualChapterk
namestringThe name of the ManualChapter (unique by all ManualChapters)
slugstringThe slugged name of the ManualChapter (unique by all ManualChapters)
sort_numberintegerThe index of the ManualChapter
department_idsstringThe Departments that are allowed to see the ManualChapter (seperated by comma). When empty, the ManualChapter will be public

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/administration/manual/chapters/3', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'name' => 'Chapter3',
        'sort_number' => 1
    ]
]);

Example Response Body

json
{
  "status": "success",
  "data": {
    "name": "Chapter3",
    "icon_id": 20,
    "slug": "chapter3",
    "sort_number": 1,
    "updated_at": "2019-01-25 15:13:21",
    "created_at": "2019-01-25 15:22:46",
    "id": 3
  }
}

[Adm.] Delete

Delete an existing ManualChapter by id.

Definition

DELETE /api/administration/manual/chapters/{id}

Example Request

php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/administration/manual/chapters/3', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response Body

json
{
  "status": "success",
  "data": null
}