Using the PatchUsers method returns an HTTP 405 error code.
Any clues?
Hi Lanhild,
HTTP 405 means âMethod not allowedâ and usually refers to the HTTP method used when sending the payload. What HTTP method did you use? Although not explicitly mentioned in the documentation, I think you need to use the PATCH
method with this endpoint. Did you maybe use POST
or PUT
?
I used the PUT
method, as specified in the documentation. I think though there might be a typo in the docs since using PUT
to âpatchâ a userâs information doesnât make much sense. Anyways, using the PATCH
method still results in the same error.
NOTA: My credentials are correct and do have the appropriate permissions.
PUT
is OK, I just tried it on my system, so the documentation is correct.
See this example:
# curl -sX GET -H "Authorization: Bearer <MYTOKEN>" "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr" | jq -r .nickname
test
# curl -sX PUT -H "Authorization: Bearer <MYTOKEN>" -H "Content-type: application/json" -d '{ "nickname": "newvalue" }' "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr/patch" | jq -r .nickname
newvalue
# curl -sX GET -H "Authorization: Bearer <MYTOKEN>" "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr" | jq -r .nickname
newvalue
Thanks, seems like somehow my curl
binary didnât pass the method correctly
Alright, thanks for confirming the solution.