Joplin API "Method not allowed"

@laurent

I try to submit update of note with PATCH or PUT method but I get that

curl -i -X PATCH -d title="NEW TITLE" -d id="6970d62cf2af43e49405d2041ce3d3bf" http://127.0.0.1:41184/notes\?token=_my_wonrderful_long_joplin_token
HTTP/1.1 405 Method Not Allowed
Content-Type: text/plain
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
Access-Control-Allow-Headers: X-Requested-With,content-type
Date: Tue, 02 Oct 2018 10:05:41 GMT
Connection: keep-alive
Transfer-Encoding: chunked

and same with PUT method

What did I miss ?

otherwise, GET/DELETE/POST work great

PATCH is not supported, but PUT is, however you need to specify the note ID in the URL.

Also you need to pass it a JSON object with the properties you want to change:

curl -i -X PUT --data '{ "title":"NEW TITLE" }' http://127.0.0.1:41184/notes/6970d62cf2af43e49405d2041ce3d3bf\?token=_my_wonrderful_long_joplin_token

ok, but not ok :slight_smile:

curl -i -X PUT --data '{"title": "NEW TITLE"}' 'http://127.0.0.1:41184/notes/6970d62cf2af43e49405d2041ce3d3bf?token=a long token'
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
Access-Control-Allow-Headers: X-Requested-With,content-type
Date: Tue, 02 Oct 2018 10:52:13 GMT
Connection: keep-alive
Transfer-Encoding: chunked

Unexpected end of JSON input

Indeed, that looks like an application error. Is there anything in any of the logs?

in log-clipper.txt there is just the PUT line as this one

2018-10-02 12:55:27: "Request: PUT /notes/6970d62cf2af43e49405d2041ce3d3bf?token=<joplin token>"

I have nothing else :frowning:

Do you want an issue on github for that?

That will be fixed in the next release :slight_smile:

1 Like