'Home Assistant: Command_line & REST Switch

I am trying to unlock my door through HA, it's a straightforward HTTPS link but in the last variable of the link "date=" we need to assign the current date, which I think is the one that is causing issues with my below code:

switch:
  - platform: command_line
    switches:
      home_door_four:
        command_on: "curl -k  https://api.ttlock.com/v3/lock/unlock?clientId=xxxxx&accessToken=xxxxx&lockId=xxxxx&date={{ (now().timestamp() | int * 1000 ) }}"
        command_off: "curl -k  https://api.ttlock.com/v3/lock/lock?clientId=xxxxx&accessToken=xxxxx&lockId=xxxxx&date={{ (now().timestamp() | int * 1000 ) }}"



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source