API: Retrieve references of an existing zettel manual api manual zettelstore zmk 00001012000000 00001012000000 00001012920000 1 (c) 2020-present by Detlef Stern 20250415154139 00001006000000 00001006030000 00001006035000 00001006050000 00001007031100 00001007040310 00001007040320 00001008010500 00001010040100 00001012050200 00001012920000 00001012930500 en EUPL-1.2-or-later 20250416181257 20250416181257 public The endpoint to retrieve references of a specific zettel is /r/{ID}, where {ID} is a placeholder for the zettel identifier. A zettel may contain references to external material, in the form of an URI. External material may be referenced via Zettelmarkup links, inline embedding, or a block transclusion. It may also be referenced within the metadata of a zettel, when a key of type URL is given. To calculate the references of a zettel, its parsed form is used. For example, to retrieve references of the zettel about CommonMark, just send a HTTP GET request to the endpoint /r/00001008010500 If authentication is enabled, you must include a valid access token in the Authorization header: # curl 'http://127.0.0.1:23123/r/00001008010500' https://commonmark.org/ https://commonmark.org/ https://xkcd.com/927/ https://github.github.com/gfm/ https://spec.commonmark.org/0.31.2/ https://github.com/yuin/goldmark If you just want metadata external references, add a query parameter part=meta: # curl 'http://127.0.0.1:23123/r/00001008010500?part=meta' https://commonmark.org/ Similarly, to retrieve only references of the zettel content, use the query parameter part=content: # curl 'http://127.0.0.1:23123/r/00001008010500?part=content' https://commonmark.org/ https://xkcd.com/927/ https://github.github.com/gfm/ https://spec.commonmark.org/0.31.2/ https://github.com/yuin/goldmark These examples should make clean, that no duplicates are removed and no sorting takes place. The client must handle this, e.g.: # curl 'http://127.0.0.1:23123/r/00001008010500' | sort -u https://commonmark.org/ https://github.com/yuin/goldmark https://github.github.com/gfm/ https://spec.commonmark.org/0.31.2/ https://xkcd.com/927/ If you add the query parameter enc=data, the result will be encoded as a symbolic expression: # curl 'http://127.0.0.1:23123/r/00001008010500?enc=data' ("https://commonmark.org/" "https://commonmark.org/" "https://xkcd.com/927/" "https://github.github.com/gfm/" "https://spec.commonmark.org/0.31.2/" "https://github.com/yuin/goldmark") Of course, you can combine the different query parameters, e.g. to retrieve an Sx list of all metadata URIs. HTTP Status codes 200 Retrieval was successful, the body contains an appropriate data value. 400 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. 403 You are not allowed to retrieve data of the given zettel. 404 Zettel not found. You probably used a zettel identifier that is not used in the Zettelstore.