Page 1 of 1

REST API PATCH Method not allowed

Posted: 02 Dec 2018, 06:19
by efratfeldman
Hello,
Well, till now I was using SOAP in all my scripts but I want to move to REST since I understand this it a better way to work. When I try to use the PATCH option to update an existing issues I get this message: "Method not allowed. Must be one of: GET, POST, DELETE"

I'm using mantis 2.7.0 schema 209
I have $g_webservice_rest_enabled = ON; in my config file and generated a Token.
I succeeded to get the GET for specific issue or for all projects to work so far, also DELETE and POST.

the command I'm using is:
curl -k --request PATCH --url 'https://<my mantis link>/api/rest/issues/' --header 'Authorization: <my token>' --header 'Content-Type: application/json' --data '{"id": 38050, "summary": "test1", "status": {"id": 50,"name": "assigned"}}'

Please advise,
Efrat.

Re: REST API PATCH Method not allowed

Posted: 02 Dec 2018, 08:20
by atrol
Updating issue using PATCH method is supported starting from version 2.8.0, see https://www.mantisbt.org/bugs/view.php?id=23396
I recommend to update to latest Mantis version (2.18.0 at the moment) as there are some more fixes and additions related to REST in it.

Re: REST API PATCH Method not allowed

Posted: 02 Dec 2018, 08:51
by efratfeldman
Thank you for the quick reply, I will work on upgrading.
If you may, I have one more question, currently in my environment can I use the method GET for specific project by id?
I tried using the command "curl -k --request GET --url 'https://<my mantis link>/api/rest/projects/127' --header 'Authorization: <my token>' " but I get "Page Not Found" as result.

Thank you,
Efrat.

Re: REST API PATCH Method not allowed

Posted: 02 Dec 2018, 09:00
by atrol

Re: REST API PATCH Method not allowed

Posted: 02 Dec 2018, 09:05
by efratfeldman
Thank you

Re: REST API PATCH Method not allowed

Posted: 24 Sep 2020, 08:45
by POTAE
Hi !

I am currently using the 2.22.1 mantisBT version.
I have the same problem of update, when I try to update an existing issue with the "PATCH" HTTP verb, I get an error telling me that "PATCH" is not allowed. The latest version is 2.24, should I upgrade in order to correct this bug or is there another way to do so ?

Thank you,

Potae