REST API PATCH Method not allowed

Get help from other users here.

Moderators: Contributor, Developer

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

REST API PATCH Method not allowed

Post by efratfeldman » Dec 02, 2018 1:19 am

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: 7525
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: REST API PATCH Method not allowed

Post by atrol » Dec 02, 2018 3:20 am

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: Dec 02, 2018 1:04 am

Re: REST API PATCH Method not allowed

Post by efratfeldman » Dec 02, 2018 3:51 am

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: 7525
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: REST API PATCH Method not allowed

Post by atrol » Dec 02, 2018 4:00 am

Please use Search before posting and read the Manual

efratfeldman
Posts: 3
Joined: Dec 02, 2018 1:04 am

Re: REST API PATCH Method not allowed

Post by efratfeldman » Dec 02, 2018 4:05 am

Thank you

Post Reply