mailerlite-api-python
mailerlite-api-python copied to clipboard
Can get and search subscriber by email
Can get and search subscriber by email, but via postman it works.
In [25]: mailerLiteApi.subscribers.get(email='[email protected]')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-25-ba3f407787d0> in <module>
----> 1 mailerLiteApi.subscribers.get(email='[email protected]')
~/.local/lib/python3.8/site-packages/mailerlite/subscriber.py in get(self, as_json, **identifier)
262 res_json['fields'] = [Field(**res) for res in res_json['fields']]
263
--> 264 return Subscriber(**res_json)
265
266 def delete(self, subscriber_id):
TypeError: __new__() got an unexpected keyword argument 'groups'
In [28]: mailerLiteApi.subscribers.search(search='[email protected]')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-28-753a59c1d509> in <module>
----> 1 mailerLiteApi.subscribers.search(search='[email protected]')
~/.local/lib/python3.8/site-packages/mailerlite/subscriber.py in search(self, search, limit, offset, minimized, as_json)
320 res['fields'] = [Field(**field) for field in res['fields']]
321
--> 322 all_subscribers = [Subscriber(**res) for res in res_json]
323 return all_subscribers
324
~/.local/lib/python3.8/site-packages/mailerlite/subscriber.py in <listcomp>(.0)
320 res['fields'] = [Field(**field) for field in res['fields']]
321
--> 322 all_subscribers = [Subscriber(**res) for res in res_json]
323 return all_subscribers
324
TypeError: __new__() got an unexpected keyword argument 'groups'
via postman is ok https://connect.mailerlite.com/api/subscribers/[email protected]
API https://developers.mailerlite.com/docs/subscribers.html#fetch-a-subscriber
Hi @silika,
Thank you for the feedback, I will look into it this weekend. It is related to #44. Also, Feel free to create a PR if you have time 😄 !