Laws.Africa Developer Guide
  • Laws.Africa Developer Guide
  • Get Started
    • Introduction
    • Quick start
    • Works and expressions
    • Webhooks
    • Changelog
  • Tutorial
    • About the tutorial
    • Module 1: Build a legislation reader
      • Introductory concepts
      • Create a basic Django app
      • Create database models
      • Fetching the data
      • Work listing page
      • Expression detail page
      • Styling with Law Widgets
      • Adding interactivity
      • Staying up to date
    • Module 2: Enrichments and interactivity
      • Basic enrichments
      • Advanced enrichments
      • Advanced interactivity
    • Module 3: Text extraction for search and analysis
      • Why extracting text is important
      • Basics of text extraction
      • Advanced text extraction
      • Extracting text for analysis and machine learning
  • Content API Reference
    • About the Content API
    • Authentication
    • Pagination
    • Places
    • All work expressions
    • Single work expression
      • Commencements
      • Embedded images
      • Publication document
      • Table of Contents
      • Timeline
    • Taxonomy topics
    • Enrichment datasets
  • AI API Reference
    • About the AI API
    • Authentication
    • Knowledge Bases
  • How-to Guides
    • How to use the Table of Contents API
    • How to download images
Powered by GitBook
On this page
  1. Content API Reference
  2. Single work expression

Table of Contents

Fetching the Table of Contents for an expression.

PreviousPublication documentNextTimeline

Last updated 1 year ago

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.

Get the Table of Contents for an expression

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

GET 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.

<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>
How to use the Table of Contents API

Get a Table of Contents (TOC)

get

API that returns a description of the table of contents (TOC) for a work.

Authorizations
Path parameters
frbr_uristringRequired

The FRBR URI of the work or work expression, without the first slash, such as akn/za/act/1994/2/

Responses
200Success
application/json
get
GET /v3/{frbr_uri}/toc HTTP/1.1
Host: 
Accept: */*
200Success
{
  "toc": [
    {
      "type": "text",
      "component": "text",
      "title": "text",
      "basic_unit": true,
      "num": "text",
      "id": "text",
      "heading": "text",
      "children": [
        {
          "type": "text",
          "component": "text",
          "title": "text",
          "basic_unit": true,
          "num": "text",
          "id": "text",
          "heading": "text",
          "children": [
            "[Circular Reference]"
          ],
          "url": "https://example.com"
        }
      ],
      "url": "https://example.com"
    }
  ]
}
  • Get the Table of Contents for an expression
  • GETGet a Table of Contents (TOC)
  • Individual parts, chapters and sections
  • Content for a single part, chapter or section