API: Retrieve parsed metadata and content of an existing zettel in various encodings

00001012053600 · Info · (manual) · #api #manual #zettelstore

The endpoint to work with parsed metadata and content of a specific zettel is /p/{ID}, where {ID} is a placeholder for the zettel identifier.

A parsed zettel is basically an unevaluated zettel: the zettel is read and analyzed, but its content is not evaluated. By using this endpoint, you are able to retrieve the structure of a zettel before it is evaluated.

For example, to retrieve some data about this zettel you are currently viewing, just send a HTTP GET request to the endpoint /v/000010120536001. If successful, the output is a JSON object:

# curl
[{"t":"Para","i":[{"t":"Text","s":"The"},{"t":"Space"},{"t":"Link","q":"zettel","s":"00001012920000","i":[{"t":"Text","s":"endpoint"}]},{"t":"Space"},{"t":"Text","s":"to"},{"t":"Space"},{"t":"Text","s":"work"},{"t":"Space"},{"t":"Text","s":"with"},{"t":"Space"}, ...

Similar to retrieving an encoded zettel, you can specify an encoding and state which part of a zettel you are interested in. The same default values applies to this endpoint.

HTTP Status codes

Retrieval was successful, the body contains an appropriate JSON object.
Request was not valid. There are several reasons for this. Maybe the zettel identifier did not consist of exactly 14 digits or _enc / _part contained illegal values.
You are not allowed to retrieve data of the given zettel.
Zettel not found. You probably used a zettel identifier that is not used in the Zettelstore.
  1. If authentication is enabled, you must include the a valid access token in the Authorization header ↩︎