We have an admin api_key that we’re using to create new topics on behalf of users. So we POST this to the
const postBody = [ "title": "Some new topic title", "category": "General", "raw": "the post of the forum topic...", "api_username": "admin_user", "api_key": "xxxxxxxxxxxxxxxxxx", ]
This works correctly so long as
api_username belongs to the admin user. If we post on behalf of another user (by changing the
api_username) then we get a 404 with the following error in the rails log:
Completed 404 Not Found in 39ms (ActiveRecord: 0.0ms) ActiveRecord::RecordNotFound (Couldn't find Category with 'id'=General)
If we alter the API POST to use the integer ID of the “General” category instead of its textual name, it then works as expected.
Why does it allow textual category specification in the former case but not the latter?