(BLOCK (PARA (TEXT "The ") (LINK-ZETTEL () "00001012920000" (TEXT "endpoint")) (TEXT " to work with metadata and content of a specific zettel is ") (LITERAL-INPUT () "/z/{ID}") (TEXT ", where ") (LITERAL-INPUT () "{ID}") (TEXT " is a placeholder for the ") (LINK-ZETTEL () "00001006050000" (TEXT "zettel identifier")) (TEXT ".")) (PARA (TEXT "For example, to retrieve some data about this zettel you are currently viewing, just send a HTTP GET request to the endpoint ") (LITERAL-INPUT () "/z/00001012053300") (ENDNOTE () (TEXT "If ") (LINK-ZETTEL () "00001010040100" (TEXT "authentication is enabled")) (TEXT ", you must include the a valid ") (LINK-ZETTEL () "00001012050200" (TEXT "access token")) (TEXT " in the ") (LITERAL-INPUT () "Authorization") (TEXT " header")) (TEXT ".")) (VERBATIM-CODE (("" . "sh")) "# curl 'http://127.0.0.1:23123/z/00001012053300'\nThe [[endpoint|00001012920000]] to work with metadata and content of a specific zettel is ''/z/{ID}'', where ''{ID}'' is a placeholder for the [[zettel identifier|00001006050000]].\n\nFor example, to retrieve some data about this zettel you are currently viewing, just send a HTTP GET request to the endpoint ''/z/00001012053300''[^If [[authentication is enabled|00001010040100]], you must include the a valid [[access token|00001012050200]] in the ''Authorization'' header].\n\n```sh\n...") (PARA (TEXT "Optionally, you may provide which parts of the zettel you are requesting.") (SOFT) (TEXT "In this case, add an additional query parameter ") (LITERAL-INPUT () "part=PART") (TEXT ".") (SOFT) (TEXT "Valid values for ") (LINK-ZETTEL () "00001012920800" (LITERAL-INPUT () "PART")) (TEXT " are ") (FORMAT-QUOTE () (TEXT "zettel")) (TEXT ", ") (FORMAT-QUOTE () (LINK-ZETTEL () "00001012053400" (TEXT "meta"))) (TEXT ", and ") (FORMAT-QUOTE () (TEXT "content")) (TEXT " (the default value).")) (VERBATIM-CODE (("" . "sh")) "# curl 'http://127.0.0.1:23123/z/00001012053300?part=zettel'\ntitle: API: Retrieve metadata and content of an existing zettel\nrole: manual\ntags: #api #manual #zettelstore\nsyntax: zmk\n\nThe [[endpoint|00001012920000]] to work with metadata and content of a specific zettel is ''/z/{ID}'', where ''{ID}'' is a placeholder for the [[zettel identifier|00001006050000]].\n\nFor example, to retrieve some data about this zettel you are currently viewing, just send a HTTP GET request to the endpoint\n...") (HEADING 1 () "data-output" "data-output" (TEXT "Data output")) (PARA (TEXT "Alternatively, you may retrieve the zettel as a parseable object / a ") (LINK-ZETTEL () "00001012930500" (TEXT "symbolic expression")) (TEXT " by providing the query parameter ") (LITERAL-INPUT () "enc=data") (TEXT ":")) (VERBATIM-CODE (("" . "sh")) "# curl 'http://127.0.0.1:23123/z/00001012053300?enc=data&part=zettel'\n(zettel (meta (back \"00001006000000 00001012000000 00001012053200 00001012054400\") (backward \"00001006000000 00001012000000 00001012053200 00001012054400 00001012920000\") (box-number \"1\") (created \"20211004093206\") (forward \"00001006020000 00001006050000 00001010040100 00001012050200 00001012053400 00001012920000 00001012920800 00001012921200 00001012930500\") (modified \"20230703174152\") (published \"20230703174152\") (role \"manual\") (syntax \"zmk\") (tags \"#api #manual #zettelstore\") (title \"API: Retrieve metadata and content of an existing zettel\")) (rights 62) (encoding \"\") (content \"The [[endpoint|00001012920000]] to work with metadata and content of a specific zettel is ''/z/{ID}'', where ''{ID}'' is a placeholder for the [[zettel identifier|00001006050000]].\\n\\nFor example, ...") (PARA (TEXT "If you print the result a little bit nicer, you will see its structure:")) (VERBATIM-CODE () "(zettel (meta (back \"00001006000000 00001012000000 00001012053200 00001012054400\")\n (backward \"00001006000000 00001012000000 00001012053200 00001012054400 00001012920000\")\n (box-number \"1\")\n (created \"20211004093206\")\n (forward \"00001006020000 00001006050000 00001010040100 00001012050200 00001012053400 00001012920000 00001012920800 00001012921200 00001012930500\")\n (modified \"20230703174152\")\n (published \"20230703174152\")\n (role \"manual\")\n (syntax \"zmk\")\n (tags \"#api #manual #zettelstore\")\n (title \"API: Retrieve metadata and content of an existing zettel\"))\n (rights 62)\n (encoding \"\")\n (content \"The [[endpoint|00001012920000]] to work with metadata and content of a specific zettel is ''/z/{ID}'', where ''{ID}'' is a placeholder for the [[zettel identifier|00001006050000]].\\n\\nFor example, ...") (UNORDERED (INLINE (TEXT "The result is a list, starting with the symbol ") (LITERAL-INPUT () "zettel") (TEXT ".")) (INLINE (TEXT "Then, some key/value pairs are following, also nested.")) (INLINE (TEXT "Nested in ") (LITERAL-INPUT () "meta") (TEXT " are the metadata, each as a key/value pair.")) (INLINE (LITERAL-INPUT () "rights") (TEXT " specifies the ") (LINK-ZETTEL () "00001012921200" (TEXT "access rights")) (TEXT " the user has for this zettel.")) (INLINE (LITERAL-INPUT () "\"encoding\"") (TEXT " states how the content is encoded.") (SOFT) (TEXT "Currently, only two values are allowed: the empty string (") (LITERAL-INPUT () "\"\"") (TEXT ") that specifies an empty encoding, and the string ") (LITERAL-INPUT () "\"base64\"") (TEXT " that specifies the ") (LINK-EXTERNAL () "https://www.rfc-editor.org/rfc/rfc4648.txt" (TEXT "standard Base64 encoding")) (TEXT ".")) (INLINE (TEXT "The zettel contents is stored as a value of the key ") (LITERAL-INPUT () "content") (TEXT ".") (SOFT) (TEXT "Typically, text content is not encoded, and binary content is encoded via Base64."))) (HEADING 1 () "http-status-codes" "http-status-codes" (TEXT "HTTP Status codes")) (DESCRIPTION ((LITERAL-INPUT () "200")) (BLOCK (BLOCK (PARA (TEXT "Retrieval was successful, the body contains an appropriate data value.")))) ((LITERAL-INPUT () "204")) (BLOCK (BLOCK (PARA (TEXT "Request was valid, but there is no data to be returned.") (SOFT) (TEXT "Most likely, you specified the query parameter ") (LITERAL-INPUT () "part=content") (TEXT ", but the zettel does not contain any content.")))) ((LITERAL-INPUT () "400")) (BLOCK (BLOCK (PARA (TEXT "Request was not valid.") (HARD) (TEXT "There are several reasons for this.") (SOFT) (TEXT "Maybe the ") (LINK-ZETTEL () "00001006050000" (TEXT "zettel identifier")) (TEXT " did not consists of exactly 14 digits.")))) ((LITERAL-INPUT () "403")) (BLOCK (BLOCK (PARA (TEXT "You are not allowed to retrieve data of the given zettel.")))) ((LITERAL-INPUT () "404")) (BLOCK (BLOCK (PARA (TEXT "Zettel not found.") (SOFT) (TEXT "You probably used a zettel identifier that is not used in the Zettelstore."))))))