Read a world document
const url = 'http://localhost:11044/api/v1/world/documents/example';const options = {method: 'GET', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”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
Responses
Section titled “Responses”Document content
A world document’s content, capped at the first 10000 characters
object
The document’s text, truncated to 10000 characters
The document name that was asked for, echoed back
The file’s full size in bytes, before truncation
Document not found
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
The document name that was asked for, echoed back unchanged
Always not_found — not the error the rest of this surface answers
Example
not_found
