REST API PATCH Method not allowed

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
efratfeldman
Posts: 3
Joined: 02 Dec 2018, 06:04

REST API PATCH Method not allowed

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: REST API PATCH Method not allowed

Post 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.
Please use Search before posting and read the Manual
efratfeldman
Posts: 3
Joined: 02 Dec 2018, 06:04

Re: REST API PATCH Method not allowed

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: REST API PATCH Method not allowed

Post by atrol »

Please use Search before posting and read the Manual
efratfeldman
Posts: 3
Joined: 02 Dec 2018, 06:04

Re: REST API PATCH Method not allowed

Post by efratfeldman »

Thank you
POTAE
Posts: 1
Joined: 24 Sep 2020, 08:34

Re: REST API PATCH Method not allowed

Post 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
Post Reply