interfax / interfax-python

Fax send and receive in Python with the InterFAX REST API
https://www.interfax.net/en/dev/python
MIT License
12 stars 13 forks source link

client.outbound.completed(*ids) generates bad urls #9

Open asedeno opened 6 years ago

asedeno commented 6 years ago

When calling client.outbound.completed(*ids), the generated url has the IDs in a tuple:

>>> c.outbound.completed(123)
HTTPError: 400 Client Error: Bad Request for url: https://rest.interfax.net/outbound/faxes/completed?ids=%28123%2C%29
>>> c.outbound.completed(123,234)
HTTPError: 400 Client Error: Bad Request for url: https://rest.interfax.net/outbound/faxes/completed?ids=%28123%2C+234%29

This generated url does not conform with the API spec, where it should only be comma-separated, as: https://rest.interfax.net/outbound/faxes/completed?ids=123%2C234

asedeno commented 6 years ago

10 will fix this.

asedeno commented 5 years ago

Looping over the args and testing against the length on every iteration rather than just using ','.join() seems wasteful and non-pythonic. Please have another look at #10 for a better way.