Extending API -- Config + Controller namespace issues?

Your software
My Mautic version is: 3.3.1
My PHP version is: 7.3.20
My Database type and version is: SQLLite 3.27.2

Your problem
My problem is:

First tried the /assets/new POST route to attempt to create asset/file from postman. However, the docs say “same as GET assets” so I’m not sure its even possible to create an asset via Rest API (if so please just tell me if possible).

Instead now, trying to make a plugin that extends API. It will eventually receive a string in request body and create a .ical asset file and return its’ id/filename, so it can be attached in an email.
But am new to PHP and missing something very basic here (namespace issue?).

These errors are showing in the log:
[2021-02-27 19:06:31] mautic.CRITICAL: Uncaught PHP Exception LogicException: "Controller not found: service "SonityIcalMauticBundle" does not exist." at /var/www/html/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php line 75 {"exception":"[object] (LogicException(code: 0): Controller not found: service \"SonityIcalMauticBundle\" does not exist. at /var/www/html/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:75)"} []

The issue showed up when I started to introduce the /Controller/Api/IcalsController.php – it is referenced in the /Config/config.php :
'api' => array( 'plugin_sonityicalmautic_api' => array( 'path' => '/icals', 'controller' => 'SonityIcalMauticBundle:Api\IcalsApi', 'method' => 'GET' ) ),

The Controller/Api/IcalsController.php uses the namespace
namespace MauticPlugin\SonityIcalMauticBundle\Controller\Api; and contains the classname IcalsController.

Steps I have tried to fix the problem:

  • renamed IcalsController.php
  • changed config references

I’m sorry to disturb – but I seem to be unable to get this basic example together. I’m more or less referencing the HelloWorldBundle example as well as developer-documentation/_plugin_extending_api.md at e84a3a8c4fac393782172349ffdbea903717c964 · mautic/developer-documentation · GitHub

A working boilerplate example, or a useful tutorial would help a great amount thanks!