Skip to content

Read a world document

GET
/api/v1/world/documents/{name}
curl --request GET \
--url http://localhost:11044/api/v1/world/documents/example \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Returns the content of a document from the world data/documents directory, truncated to the first 10000 characters.

name
required
string

File name of a document directly inside the world’s data/documents directory, as listed by GET /world/documents; a name that is missing, is a directory, or resolves anywhere else (a subdirectory, ..) answers 404

Document content

Media type*/*

A world document’s content, capped at the first 10000 characters

object
content
required

The document’s text, truncated to 10000 characters

string
name
required

The document name that was asked for, echoed back

string
size
required

The file’s full size in bytes, before truncation

integer format: int64

Document not found

Media type*/*

A document this world does not have. Carries the name asked for rather than a sentence, because the only fact is which name missed

object
name
required

The document name that was asked for, echoed back unchanged

string
status
required

Always not_found — not the error the rest of this surface answers

string

Example

not_found