User invalid er

I am setting up a custom api route using annotations and I am just getting a User invalid when accessing this endpoint:


The key is valid because I can get data from the pimcore webservice with it.

Here is the code of my controller handling the request and a screenshot of the error - it never seems to fire as the var_dump never happens. I get a 403 error from the system stating the User is invalid

namespace AppBundle\Controller\Admin;

use Pimcore\Bundle\AdminBundle\Controller\Rest\AbstractRestController;
use Pimcore\Model\Document;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;

class DocumentApiController extends AbstractRestController

     * @Route("/api/document", name="hdmz_api_document", methods={"POST"})
    public function documentAction(Request $request)
        var_dump('here we are'); exit;

Hi @justbane,

Does it work if you change the route to something like /webservice/api/document. As far as I know the webservice authenticator only works on routes beginning with /webservice. See

Hope this helps!

1 Like

Bingo, that was it. Thanks!!