Hello,
I’m trying to create an API resource for a record that is not in the database, but generated with given Item and User (something like /api/recommendation?item=x&user=y).
Since apparently the default api controller requires that the record is in the database, i’ve added ‘controller’ => ‘recommendation’ to the api_resource filter, but the api request always returns “message”: “Invalid controller specified (recommendation)” . I’ve tried creating a controller (RecommendationController.php) with class called MyPlugin_RecommendationController and put in the myplugin/controllers folder or in a myplugin/controllers/api folder but neither of them work, always shows that message for invalid controller.
Does anyone know what I am doing wrong?
Thanks in advance!