Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Can get and search subscriber by email #55

Open
silika opened this issue Jan 6, 2023 · 1 comment
Open

Can get and search subscriber by email #55

silika opened this issue Jan 6, 2023 · 1 comment

Comments

@silika
Copy link

silika commented Jan 6, 2023

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

@silika silika changed the title Can get subscriber and search Can get and search subscriber by email Jan 6, 2023
@skoudoro
Copy link
Owner

skoudoro commented Jan 6, 2023

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 😄 !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants