Okay, thanks for the explanation, I was not aware of the difference.
I set user_id to NULL, but still get the 403 response.
For reference:
- I created a token in the
api_keys table with user_id = NULL
- I call the API with
['token' => config('forum.forum_api_key') . '; userId=1'],
- I create a data array as shown in my first post (tried default flarum-core permissions as well, the one shown is a permission from an extension)
- I submit a patch request
$this->api->users($forum_user_id)->patch($data)->request();
What works with the sequence:
- create any user
- update any user
- upload an avatar for any user
Only the preferences update does not work, not for my user (who is the admin) nor for any other user (which I could understand if there is a restriction even for admins since I also cannot set preferences in the UX for other users).
Maybe the preference is not named correctly and therefor rejected? Don't know if that would result in a 403 response rather than 400.