Awaiting feedback silent and clear_edit parameters are ignored in "POST /api/posts/:id"

yar

Member
Affected version
2.2.13
Making request like this to edit post via XF's REST API:
POST /api/posts/164 HTTP/1.1
Host: ...
XF-Api-Key: wF-...
Content-Type: application/x-www-form-urlencoded
Content-Length: 51

| message=lorem+ipsum+dolor+sit&silent=1&clear_edit=1

Post is succesfully edited without any error messages but both silent and clear_edit params are being ignored. Tried values like "1" and "true" - no difference, not working.

I would expect this to work as mentioned in REST API endpoints documentation:
Am I doing something wrong? Thanks!
 
Are you bypassing permissions or, if not, does the user you're authenticated as have the 'Edit any post' permission? If not, then this is expected. It's the same behavior as in the front-end, and noted in the API docs.
 
Are you bypassing permissions or, if not, does the user you're authenticated as have the 'Edit any post' permission? If not, then this is expected. It's the same behavior as in the front-end, and noted in the API docs.

Ok, the moment I gave user Forum moderator permissions "Edit any post", it started to work as expected.

So, silent and clear_edit flags are allowed only to those who have "Edit any post", regular "Edit own posts" is not enough. Thanks for clarification!

It would make sense for API intead of quietly ignoring those parameters to throw error message telling about lack of permissions, that would help and point into where the problem is. Thanks again!
 
Top Bottom