Hi,
I encountered exactly the same issue and found another solution.
Indeed, using custom response handler worked well to set URL arguments but I didn't find how to use it to set tokens in URL path (ex : http://myendpoint/api/$token$/search).
After analyzing rest_ta/bin/rest.py, I found this part of the script, which is executed for each polling (begins at line 465 in version 1.4 of the REST Modular Input App) :
while True:
if polling_type == 'cron':
next_cron_firing = cron_iter.get_next(datetime)
while get_current_datetime_for_cron() != next_cron_firing:
time.sleep(float(10))
for endpoint in endpoint_list:
if "params" in req_args:
req_args_params_current = dictParameterToStringFormat(req_args["params"])
else:
(...)
The problem is that the endpoint_list variable is set the first time the script runs, but is never updated after that.
I added the functions used when the script starts, before the " for endpoint in endpoint_list " loop as below :
while True:
if polling_type == 'cron':
next_cron_firing = cron_iter.get_next(datetime)
while get_current_datetime_for_cron() != next_cron_firing:
time.sleep(float(10))
original_endpoint=config.get("endpoint")
#token replacement
endpoint_list = replaceTokens(original_endpoint)
for endpoint in endpoint_list:
if "params" in req_args:
req_args_params_current = dictParameterToStringFormat(req_args["params"])
else:
(...)
After that, tokens are always updated with tokens.py file before the REST API is polled.
Damien, if the answer is correct, is it possible to update the rest.py script for the next version of the REST Modular Input App ?
Thank you in advance, and sorry for my english, I didn't speak for a while 🙂
... View more