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

Embedded images

Fetch metadata and files for images embedded in the content of a work expression.

PreviousCommencementsNextPublication document

Last updated 1 year ago

Some documents include images. The media API includes metadata for these images, and provides a mechanism to fetch the images from the API so that you can store them and serve them to your users when they view the content.

List media files for a work expression

Download a media file

get

API for fetching media files (usually images) embedded in a document.

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/

Query parameters
pageintegerOptional

A page number within the paginated result set.

page_sizeintegerOptional

Number of results to return per page.

Responses
200Success
application/json
get
GET /v3/{frbr_uri}/media HTTP/1.1
Host: 
Accept: */*
200Success
{
  "count": 123,
  "next": "text",
  "previous": "text",
  "results": [
    {
      "url": "https://example.com",
      "filename": "text",
      "mime_type": "text",
      "size": 1
    }
  ]
}
get

Download a media file.

Authorizations
Path parameters
filenamestringRequiredPattern: ^.*$
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
Responsestring ยท binary
get
GET /v3/{frbr_uri}/media/{filename} HTTP/1.1
Host: 
Accept: */*
200Success
binary
  • List media files for a work expression
  • GET/v3/{frbr_uri}/media
  • Download a media file
  • GET/v3/{frbr_uri}/media/{filename}