> For the complete documentation index, see [llms.txt](https://developers.laws.africa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.laws.africa/content-api/reference/works-and-expressions/table-of-contents.md).

# Table of Contents

You can get a description of the table of contents (TOC) of a work. This includes the chapters, parts, sections and schedules that make up the legislation.

{% content-ref url="/pages/-LrrqlH6pyLthTgiKZs0" %}
[How to use the Table of Contents API](/content-api/how-to-use-the-table-of-contents-api.md)
{% endcontent-ref %}

## Get the Table of Contents for an expression

{% openapi src="/files/4kNXPoVcclCo2986qOST" path="/v3/{frbr\_uri}/toc" method="get" %}
[Laws.Africa Content API 2024-04-23.yaml](https://4163728571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LrrJ5L0RJ3goKWzqKVC%2Fuploads%2FYkGoMScj3txq3sbsbbwo%2FLaws.Africa%20Content%20API%20\(v3\)%20\(2\).yaml?alt=media\&token=7476d4cb-8aff-4c63-8ec8-44782e977024)
{% endopenapi %}

## Individual parts, chapters and sections

You can use the `url` field from an item in the Table of Contents to fetch the details of just that item in XML or HTML.

## Content for a single part, chapter or section

<mark style="color:blue;">`GET`</mark> `https://api.laws.africa/v3/:frbr-uri/:toc-item.:format`

Get the content of a particular Table of Contents item.

#### Path Parameters

| Name     | Type   | Description                           |
| -------- | ------ | ------------------------------------- |
| frbr-uri | string | The full FRBR URI for the expression. |
| toc-item | string | The Table of Contents item to fetch.  |
| format   | string | Response format: XML or HTML.         |

{% tabs %}
{% tab title="200 The HTML or XML of the requested item." %}

```markup
<section class="akn-section" id="section-9" data-id="section-9"><h3>9. The rescue of stray dogs</h3>
<section class="akn-paragraph akn--no-indent" id="section-9.paragraph-0" data-id="section-9.paragraph-0">
<span class="akn-content"><span class="akn-p">A <span class="akn-term" data-refersTo="#term-person" id="trm257" data-id="trm257">person</span> who rescues a stray <span class="akn-term" data-refersTo="#term-dog" id="trm258" data-id="trm258">dog</span> shall report the date and time of the rescue and a description of the <span class="akn-term" data-refersTo="#term-dog" id="trm259" data-id="trm259">dog</span> to the <span class="akn-term" data-refersTo="#term-Council" id="trm260" data-id="trm260">Council</span> within twenty four hours.</span></span></section></section>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.laws.africa/content-api/reference/works-and-expressions/table-of-contents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
