Closed emmanueljob closed 6 years ago
To remove "Additional Sites" from strategy targetting the API docs say to send an empty post to domain_restrictions for a strategy: https://developer.mediamath.com/docs/read/execution_and_management_api/Strategies#domain-restrictions
This client does not allow for empty posts: https://github.com/MediaMath/t1-python/blob/master/terminalone/connection.py#L227
Code example (Doesn't work):
t1 = terminalone.T1(auth_method="cookie", **creds) id = .... strat = t1.get('strategies', id, include="campaign") strat.save_domains({})
Code example (Hack workaround that works):
t1 = terminalone.T1(auth_method="cookie", **creds) id = .... strat = t1.get('strategies', id, include="campaign") strat.save_domains({"a": "b"})
Maybe we can allow an override on the post method that says I am explicitly sending an empty post (https://github.com/MediaMath/t1-python/blob/master/terminalone/connection.py#L220) add a param "allowEmptyPost" or something like that. Then every call that allows empty posts could send allowEmptyPost=True
Hi Emmanuel,
Thanks for identifying this bug. We'll prioritize this fix.
@emmanueljob 1.8.2 now allows posting of an empty dict as the data param using the _post function.
data
_post
To remove "Additional Sites" from strategy targetting the API docs say to send an empty post to domain_restrictions for a strategy: https://developer.mediamath.com/docs/read/execution_and_management_api/Strategies#domain-restrictions
This client does not allow for empty posts: https://github.com/MediaMath/t1-python/blob/master/terminalone/connection.py#L227
Code example (Doesn't work):
t1 = terminalone.T1(auth_method="cookie", **creds) id = .... strat = t1.get('strategies', id, include="campaign") strat.save_domains({})
Code example (Hack workaround that works):
t1 = terminalone.T1(auth_method="cookie", **creds) id = .... strat = t1.get('strategies', id, include="campaign") strat.save_domains({"a": "b"})
Maybe we can allow an override on the post method that says I am explicitly sending an empty post (https://github.com/MediaMath/t1-python/blob/master/terminalone/connection.py#L220) add a param "allowEmptyPost" or something like that. Then every call that allows empty posts could send allowEmptyPost=True