Hardware Switch toggles HA API

Hi there

I’ve got a new hardware switch with the possibility to send post/get Requests. Whats the correct way to integrate this in Home Assistant?

To begin i would simply toggle a light. I have the HA API up and running and can call successful /api/services/light/turn_on but that way, i need the Bearer Token which i can’t send through my switch. I’ve also tried to set trusted_networks but only got 401: Unauthorized.

Sorry, for me it seems to be a beginner question but i don’t get the principle behind this.

Regards and thanks,