How to Access an OpenCart Extension Controller as an OpenCart API

69 Views Asked by At

I have developed an OpenCart extension that includes a custom controller located at /upload/extension/myExtension/admin/controller/module/orders.php. This controller handles specific functionality related to orders within my extension.

Now, I want to expose this controller as an API in OpenCart so that external applications can access it. The challenge I'm facing is that this controller requires user authentication, but I want to allow access to it without front-end authentication and use API authentication instead.

Is there a way to achieve this in OpenCart? How can I expose my extension's controller as an API endpoint without requiring the same user authentication that the regular admin panel uses?

To provide some context, the route to my extension controller is: /upload/my-admin/index.php?route=extension/myExtension/module/orders&user_token=123....

Any guidance or code examples would be greatly appreciated!

0

There are 0 best solutions below