Python API to interface a lock

I am trying to lock/unlock a door using the python API
Looking at the code provided here: https://developers.home-assistant.io/docs/en/external_api_rest_python.html

My lock’s name is “lock1” and I am fairly certain the service used to lock things is “lock.lock”

When I run this code, I get a timeout error. If I manually set the timeout to 15, the code runs with no errors, but the door does not lock.
domain = ‘zwave’
switch_name = ‘zwave.lock1’
remote.call_service(api, domain, ‘lock.lock’, {‘entity_id’: ‘{}’.format(switch_name)})