---
title: "Retrieve parts of a document transformed via ODD"
method: GET
path: "/api/parts/{doc}/{format}"
tags: ["documents"]
---

# Retrieve parts of a document transformed via ODD

`GET /api/parts/{doc}/{format}`

## Request

- Base URL: `/exist/apps/tei-publisher` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/exist/apps/tei-publisher/api/parts/{doc}/{format}`
- Auth: one of:
  - API key in cookie `teipublisher.com.login`
  - HTTP basic

Retrieve a document fragment, usually a division or page, transformed to HTML via the ODD. This operation is internally used by pb-view, but can also be helpful with pb-load or in other contexts.

## Path parameters

- `doc` string, required
- `format` 'json' | 'html', required

## Query parameters

- `odd` string
- `view` 'page' | 'div' | 'single'
- `root` string
- `id` string
- `xpath` string
- `map` string
- `highlight` string
- `serialize` 'xml' | 'html5'
- `wrap` boolean

## Headers

- `If-Modified-Since` string

## Response `200`

OK

- object
  - `view` string: the view type used
  - `doc` string: path to the document from which the fragment was retrieved
  - `root` string, nullable
  - `odd` string: the ODD used for the transformation
  - `next` string, nullable: points to the next fragment in the document. Pass this value as `root` in a follow up request.
  - `previous` string, nullable: points to the previous fragment in the document. Pass this value as `root` in a follow up request.
  - `switchView` string, nullable
  - `content` string: the content of the fragment as HTML string
  - `footnotes` string, nullable

## Other responses

- `404`: Document not found

## Changes

- **2026-07-17** `07216792837f`: 1 info
  - added the new optional `query` request parameter `wrap`
- **2024-05-14** `ccad1ffd47ea`: 1 info
  - added the new optional `query` request parameter `serialize`
- **2022-04-29** `d17d03cb77e8`: 1 info
  - added the new optional `header` request parameter `If-Modified-Since`
- **2020-10-14** `b70359972942`: 1 info
  - added the new optional `query` request parameter `odd`

[Operation history](https://skmtc.dev/eeditiones/apis/tei-publisher-documentation-and-demo/changes/api/parts/:doc/:format/get.md)

---

[API](https://skmtc.dev/eeditiones/apis/tei-publisher-documentation-and-demo.md) - [All operations](https://skmtc.dev/eeditiones/apis/tei-publisher-documentation-and-demo/llms.txt) - [OpenAPI document](https://skmtc.dev/eeditiones/apis/tei-publisher-documentation-and-demo/revisions/07216792837f?raw)
