Extending Wave API


Dec 2nd, 2022 05:46 AM

Hello, I was wondering if there were any examples of extending the API. I've gone through https://wave.devdojo.com/docs/features/api and have reviewed the overriding files guide: https://voyager-docs.devdojo.com/customization/overriding-files, as well as looked at the code, but it's still not clear to me. I'm basically trying to set up a new route and I guess a datatype, but struggling to figure out how to do that. I basically want to call a function in Wave when I hit that API. Any help would be much appreciated, thanks!


Dec 2nd, 2022 06:16 AM

Best Answer

Hey there!

I believe that you don't need to manually add any datatypes, this should automatically happen whenever you create a new BREAD in Voyager:

BREAD Builder

Once you add the bread and update the roles and permissions, you will be able to use it via the API as well.

In case that you need to make some changes to the existing API functionality, you can edit the following file directly: wave/src/Http/Controllers/API/ApiController.php.

Let me know if you have any questions!