You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User-Provided mintime Not Being Sent in Telephony V2 Requests
Description
Arguments are not being passed in the request parameters to the telephony V2 endpoint consistently. The biggest issue is with passing back mintime, where when provided, it's not respected, this seems to be due to mintime being set to 0 by default in the get_telephony_log function, which is maintaining support for both API versions 1 and 2.
Expected Behavior
When making a request to the telephony V2 endpoint, all user-provided values that are supported by the endpoint should be included in the request parameters.
Actual Behavior
Example 1:
Most notably, mintime is incorrect in the request parameters, even though it's passed in params on function call. Other parameters are passed correctly when calling the function using **params.
When calling the function with kwargs=params (as shown in log_examples), none of the user-provided arguments are sent as part of the request to the endpoint. This seems to be due to kwargs being incorrectly structured—kwargs ends up as a dictionary with a single key, "kwargs", which contains the user-provided parameters. As a result, the get_params_from_kwargs function is unable to access them properly and include them in the request.
Call get_telephony_log with api_version=2 and a params dictionary containing mintime.
Observe the kwargs after get_params_from_kwargs.
Check the request parameters being sent to the /admin/v2/logs/telephony endpoint.
Notice that mintime is not what was provided when calling the get_telephony_log function , and if maxime was provided by the user, that is replaced by a default value generated by get_default_request_times()
Workarounds
Right now, there’s no direct fix without modifying either the get_telephony_log or get_params_from_kwargs functions, unless I'm using the code incorrectly—if that’s the case, please let me know.
I’m working around this issue by skipping the get_telephony_log function entirely and calling Telephony.get_telephony_logs_v2(admin_api.json_api_call, admin_api.host, **params) directly to avoid the issue. However, a proper fix would involve updating get_telephony_log to correctly handle parameters for both API versions 1 and 2.
The text was updated successfully, but these errors were encountered:
User-Provided
mintime
Not Being Sent in Telephony V2 RequestsDescription
Arguments are not being passed in the request parameters to the telephony V2 endpoint consistently. The biggest issue is with passing back
mintime
, where when provided, it's not respected, this seems to be due tomintime
being set to0
by default in theget_telephony_log
function, which is maintaining support for both API versions 1 and 2.Expected Behavior
When making a request to the telephony V2 endpoint, all user-provided values that are supported by the endpoint should be included in the request parameters.
Actual Behavior
Example 1:
Most notably,
mintime
is incorrect in the request parameters, even though it's passed in params on function call. Other parameters are passed correctly when calling the function using **params.kwargs after
get_params_from_kwargs
: {'maxtime': 1739597270321, 'limit': 10}Path
: admin/v2/logs/telephonyParams sent
: {'maxtime': '1739597270321', 'limit': '10', 'mintime': '1724046071273'}Example 2:
When calling the function with
kwargs=params
(as shown in log_examples), none of the user-provided arguments are sent as part of the request to the endpoint. This seems to be due to kwargs being incorrectly structured—kwargs ends up as a dictionary with a single key, "kwargs", which contains the user-provided parameters. As a result, theget_params_from_kwargs
function is unable to access them properly and include them in the request.kwargs after
get_params_from_kwargs
: {'kwargs': {'mintime': 1724045217601, 'maxtime': 1739597270321, 'limit': 10, 'next_offset': None}}Path
: admin/v2/logs/telephonyParams sent
: {'mintime': '1724045902424', 'maxtime': '1739597902304'}Steps to Reproduce
get_telephony_log
withapi_version=2
and aparams
dictionary containingmintime
.kwargs
afterget_params_from_kwargs
./admin/v2/logs/telephony
endpoint.mintime
is not what was provided when calling theget_telephony_log
function , and ifmaxime
was provided by the user, that is replaced by a default value generated byget_default_request_times()
Workarounds
Right now, there’s no direct fix without modifying either the
get_telephony_log
orget_params_from_kwargs
functions, unless I'm using the code incorrectly—if that’s the case, please let me know.I’m working around this issue by skipping the
get_telephony_log
function entirely and callingTelephony.get_telephony_logs_v2(admin_api.json_api_call, admin_api.host, **params)
directly to avoid the issue. However, a proper fix would involve updatingget_telephony_log
to correctly handle parameters for both API versions 1 and 2.The text was updated successfully, but these errors were encountered: