There is a restful switch for that. However this requires your switch to support receiving the desired switch state in the payload of the request, not as query parameter.
If that does not work with your particular rest service, but your original rest command does work, you could try combining all that into a template switch which lets you call a service (=rest command) for each state.
I guess it comes down to what kind of control you need - if you only need to unlock the door and want some UI control, the fastest option may be to keep that rest_command and embed it into a script. The script would just call that rest command service, and you can then add the script as an entity to your user interface.
Do you also have a way to “CloseDoor”, and a way to retrieve from the API if the door is opened or closed?
If so, a restful switch, like @exxamalte mentionned, is the way to go.
If you cannot determine whether the door is opened or closed, a rest service, called by a button on the UI, for instance, is probably what you want.
@exxamalte I got the switch part working, only the state part is not working. But I am able use the state on sensor.7545_door_status 0 for closed 1 for open. Also rest switch is repeating it repeating it self, I think due to the state is missing.
Can I make it the state work like this
is_on_template: "{{ states('sensor.7545_door_status) | int = 1 }}"
There are two small issues - there is a quote missing at the end of the entity ID. And the comparison must use two equal signs: is_on_template: "{{ states('sensor.7545_door_status') | int == 1 }}"