(BLOCK (PARA (TEXT "Updating metadata and content of a zettel is technically quite similar to ") (LINK-ZETTEL () "00001012053200" (TEXT "creating a new zettel")) (TEXT ".") (SOFT) (TEXT "In both cases you must provide the data for the new or updated zettel in the body of the HTTP request.")) (PARA (TEXT "One difference is the endpoint.") (SOFT) (TEXT "The ") (LINK-ZETTEL () "00001012920000" (TEXT "endpoint")) (TEXT " to update a zettel is ") (LITERAL-INPUT () "/z/{ID}") (TEXT ", where ") (LITERAL-INPUT () "{ID}") (TEXT " is a placeholder for the ") (LINK-ZETTEL () "00001006050000" (TEXT "zettel identifier")) (TEXT ".") (SOFT) (TEXT "You must send a HTTP PUT request to that endpoint.")) (PARA (TEXT "The zettel must be encoded in a ") (LINK-ZETTEL () "00001006000000" (TEXT "plain")) (TEXT " format: first comes the ") (LINK-ZETTEL () "00001006010000" (TEXT "metadata")) (TEXT " and the following content is separated by an empty line.") (SOFT) (TEXT "This is the same format as used by storing zettel within a ") (LINK-ZETTEL () "00001006010000" (TEXT "directory box")) (TEXT ".")) (VERBATIM-CODE () "# curl -X PUT --data $'title: Updated Note\\n\\nUpdated content.' http://127.0.0.1:23123/z/00001012054200") (HEADING 1 () "data-input" "data-input" (TEXT "Data input")) (PARA (TEXT "Alternatively, you may encode the zettel as a parseable object / a ") (LINK-ZETTEL () "00001012930500" (TEXT "symbolic expression")) (TEXT " by providing the query parameter ") (LITERAL-INPUT () "enc=data") (TEXT ".") (SOFT) (TEXT "The encoding is the same as the data output encoding when you ") (LINK-ZETTEL () "00001012053300#data-output" (TEXT "retrieve a zettel")) (TEXT ".")) (PARA (TEXT "The encoding for ") (LINK-ZETTEL () "00001012921200" (TEXT "access rights")) (TEXT " must be given, but is ignored.") (SOFT) (TEXT "You may encode computed or property ") (LINK-ZETTEL () "00001006020000" (TEXT "metadata keys")) (TEXT ", but these are also ignored.")) (HEADING 1 () "http-status-codes" "http-status-codes" (TEXT "HTTP Status codes")) (DESCRIPTION ((LITERAL-INPUT () "204")) (BLOCK (BLOCK (PARA (TEXT "Update was successful, there is no body in the response.")))) ((LITERAL-INPUT () "400")) (BLOCK (BLOCK (PARA (TEXT "Request was not valid.") (SOFT) (TEXT "For example, the request body was not valid.")))) ((LITERAL-INPUT () "403")) (BLOCK (BLOCK (PARA (TEXT "You are not allowed to delete 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."))))))