HTTP Binding Rule with current date variable

Hi,

Maybe this is an easy task, but i dont know how to solve this… i’ve read a lot of examples on the forum, but cant find a solution…

I have a item:

Switch MyItem1 { http=">[ON:POST:http://sample.com/pos?where=<VALUE_1>&since=<DATE_in_UTC>{Authorization=Bearer TOKEN}] >[OFF:POST:http://sample.com/pos?where=<VALUE_2>&since=<DATE_in_UTC>{Authorization=Bearer TOKEN}]" }

How can i pass the current date (formated in UTC) to the Item, so that the request sends it to the API?

This should be possible with a rule… but i dont know how structure it should have… and how to send the values to the switch item…

Any help is much appreciated
Thanks

Nope, This is a 1.x version binding with limited options.
If you want to build URLs in a rule, consider using HTTP actions

I’m not sure that you can format to UTC, but one of the limited binding options is to insert parts of the current datetime into the url using substitution %1
It’s described in the docs under “Dynamic URLs”

1 Like