Best way for state dependent external rest call

Hey there, I want to set a Shelly property (I/O action) by Rest Call dependent on two input_boolean’s states. The last part of the URL differs depending on whether both booleans are true, false or differ.

I could of course do 4 automations, which each filtering for the proper state combination, but maybe there is a better way suing template to achieve sth like

base_url: http://api.shelly/action?
part1: url[]=only if boolean 1 is true
part2: url[]=only if boolean 2 is true

call base_url+part1+part2

Or something like

case
  boo1 and boo2:
    url=12
  boo1 and !boo2:
    url=1
  !boo1 and boo2:
    url=2
  !boo1 and !boo2:
  url=

thanks for your input!

I was wondering if that could be achieved by using a restful sensor? In best case I could even get the state from the API that way?

# Example configuration.yaml entry
sensor:
  - platform: rest
    resource_template: http://IP_ADDRESS/{{ now().strftime('%Y-%m-%d') }}
    headers:
      Authorization: >
        Bearer {{ states("input_text.my_access_token") }}
    params:
      start_date: >
        {{ (now() - timedelta(days = 1)).strftime('%Y-%m-%d') }}