(((meta (@ (content . "API: Rename a zettel") (name . "title"))) (meta (@ (content . "manual") (name . "role"))) (meta (@ (content . "#api #manual #zettelstore") (name . "tags"))) (meta (@ (content . "zmk") (name . "syntax"))) (meta (@ (content . "00001012000000") (name . "back"))) (meta (@ (content . "00001012000000 00001012920000") (name . "backward"))) (meta (@ (content . "1") (name . "box-number"))) (meta (@ (content . "(c) 2020-present by Detlef Stern ") (name . "copyright"))) (meta (@ (content . "20210713150005") (name . "created"))) (meta (@ (content . "00001004011200 00001005090000 00001006050000 00001010070600 00001012053300 00001012920000") (name . "forward"))) (meta (@ (content . "en") (name . "lang"))) (meta (@ (content . "EUPL-1.2-or-later") (name . "license"))) (meta (@ (content . "20221219154659") (name . "modified"))) (meta (@ (content . "20221219154659") (name . "published"))) (meta (@ (content . "public") (name . "visibility")))) (p "Renaming" " " "a" " " "zettel" " " "is" " " "effectively" " " "just" " " "specifying" " " "a" " " "new" " " "identifier" " " "for" " " "the" " " "zettel." " " "Since" " " "more" " " "than" " " "one" " " (a (@ (href . "00001004011200")) "box") " " "might" " " "contain" " " "a" " " "zettel" " " "with" " " "the" " " "old" " " "identifier," " " "the" " " "rename" " " "operation" " " "must" " " "success" " " "in" " " "every" " " "relevant" " " "box" " " "to" " " "be" " " "overall" " " "successful." " " "If" " " "the" " " "rename" " " "operation" " " "fails" " " "in" " " "one" " " "box," " " "Zettelstore" " " "tries" " " "to" " " "rollback" " " "previous" " " "successful" " " "operations.") (p "As" " " "a" " " "consequence," " " "you" " " "cannot" " " "rename" " " "a" " " "zettel" " " "when" " " "its" " " "identifier" " " "is" " " "used" " " "in" " " "a" " " "read-only" " " "box." " " "This" " " "applies" " " "to" " " "all" " " (a (@ (href . "00001005090000")) "predefined" " " "zettel") "," " " "for" " " "example.") (p "The" " " (a (@ (href . "00001012920000")) "endpoint") " " "to" " " "rename" " " "a" " " "zettel" " " "is" " " (kbd "/z/{ID}") "," " " "where" " " (kbd "{ID}") " " "is" " " "a" " " "placeholder" " " "for" " " "the" " " (a (@ (href . "00001006050000")) "zettel" " " "identifier") "." " " "You" " " "must" " " "send" " " "a" " " "HTTP" " " "MOVE" " " "request" " " "to" " " "this" " " "endpoint," " " "and" " " "you" " " "must" " " "specify" " " "the" " " "new" " " "zettel" " " "identifier" " " "as" " " "an" " " "URL," " " "placed" " " "under" " " "the" " " "HTTP" " " "request" " " "header" " " "key" " " (kbd "Destination") ".") (pre (code "# curl -X MOVE -H \"Destination: 10000000000001\" http://127.0.0.1:23123/z/00001000000000")) (p "Only" " " "the" " " "last" " " "14" " " "characters" " " "of" " " "the" " " "value" " " "of" " " (kbd "Destination") " " "are" " " "taken" " " "into" " " "account" " " "and" " " "those" " " "must" " " "form" " " "an" " " "unused" " " (a (@ (href . "00001006050000")) "zettel" " " "identifier") "." " " "If" " " "the" " " "value" " " "contains" " " "less" " " "than" " " "14" " " "characters" " " "that" " " "do" " " "not" " " "form" " " "an" " " "unused" " " "zettel" " " "identifier," " " "the" " " "response" " " "will" " " "contain" " " "a" " " "HTTP" " " "status" " " "code" " " (kbd "400") "." " " "All" " " "other" " " "characters," " " "besides" " " "those" " " "14" " " "digits," " " "are" " " "effectively" " " "ignored." " " "However," " " "the" " " "value" " " "should" " " "form" " " "a" " " "valid" " " "URL" " " "that" " " "could" " " "be" " " "used" " " "later" " " "to" " " (a (@ (href . "00001012053300")) "read" " " "the" " " "content") " " "of" " " "the" " " "freshly" " " "renamed" " " "zettel.") (h2 (@ (id . "http-status-codes")) "HTTP" " " "Status" " " "codes") (dl (dt (kbd "204")) (dd (p "Rename" " " "was" " " "successful," " " "there" " " "is" " " "no" " " "body" " " "in" " " "the" " " "response.")) (dt (kbd "400")) (dd (p "Request" " " "was" " " "not" " " "valid." " " "For" " " "example," " " "the" " " "HTTP" " " "header" " " "did" " " "not" " " "contain" " " "a" " " "valid" " " (kbd "Destination") " " "key," " " "or" " " "the" " " "new" " " "identifier" " " "is" " " "already" " " "in" " " "use.")) (dt (kbd "403")) (dd (p "You" " " "are" " " "not" " " "allowed" " " "to" " " "delete" " " "the" " " "given" " " "zettel." " " "In" " " "most" " " "cases" " " "you" " " "have" " " "either" " " "not" " " "enough" " " (a (@ (href . "00001010070600")) "access" " " "rights") " " "or" " " "at" " " "least" " " "one" " " "box" " " "containing" " " "the" " " "given" " " "identifier" " " "operates" " " "in" " " "read-only" " " "mode.")) (dt (kbd "404")) (dd (p "Zettel" " " "not" " " "found." " " "You" " " "probably" " " "used" " " "a" " " "zettel" " " "identifier" " " "that" " " "is" " " "not" " " "used" " " "in" " " "the" " " "Zettelstore."))) (h2 (@ (id . "rationale-for-the-move-method")) "Rationale" " " "for" " " "the" " " "MOVE" " " "method") (p "HTTP" " " (a (@ (class . "external") (href . "https://www.rfc-editor.org/rfc/rfc7231.txt")) "standardizes") " " "eight" " " "methods." " " "None" " " "of" " " "them" " " "is" " " "conceptually" " " "close" " " "to" " " "a" " " "rename" " " "operation.") (p "Everyone" " " "is" " " "free" " " "to" " " (@L (@H "“") "invent" (@H "”")) " " "some" " " "new" " " "method" " " "to" " " "be" " " "used" " " "in" " " "HTTP." " " "To" " " "avoid" " " "a" " " "divergency," " " "there" " " "is" " " "a" " " (a (@ (class . "external") (href . "https://www.iana.org/assignments/http-methods/")) "methods" " " "registry") " " "that" " " "tracks" " " "those" " " "extensions." " " "The" " " (a (@ (class . "external") (href . "https://www.rfc-editor.org/rfc/rfc4918.txt")) "HTTP" " " "Extensions" " " "for" " " "Web" " " "Distributed" " " "Authoring" " " "and" " " "Versioning" " " "(WebDAV)") " " "defines" " " "the" " " "method" " " "MOVE" " " "that" " " "is" " " "quite" " " "close" " " "to" " " "the" " " "desired" " " "rename" " " "operation." " " "In" " " "fact," " " "some" " " "command" " " "line" " " "tools" " " "use" " " "a" " " (@L (@H "“") "move" (@H "”")) " " "method" " " "for" " " "renaming" " " "files.") (p "Therefore," " " "Zettelstore" " " "adopts" " " "somehow" " " "WebDAV's" " " "MOVE" " " "method" " " "and" " " "its" " " "use" " " "of" " " "the" " " (kbd "Destination") " " "HTTP" " " "header" " " "key."))