sendinblue / APIv3-python-library

SendinBlue's python library for API v3
MIT License
82 stars 40 forks source link

Issue calling `get_contact_info()` for existing contact python api v5 #33

Closed QuillyT closed 5 years ago

QuillyT commented 5 years ago

sib-api-v3-sdk: v5.0.0 (python)

I am having issues with get_contact_info(). The object I get back doesn't seem to have all the contact data.

>>> contact = api.api_instance.get_contact_info("test_email@gmail.com")
{'statistics': {u'messagesSent': [{u'campaignId': 27,
                                   u'eventTime': u'2019-03-08T11:31:06.348-08:00'},
                                  {u'campaignId': 25,
                                   u'eventTime': u'2019-03-15T13:03:31.329-07:00'}]}}
>>> type(contact)
<class 'sib_api_v3_sdk.models.get_extended_contact_details.GetExtendedContactDetails'>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/PROJECT/lib/python2.7/site-packages/sib_api_v3_sdk/models/get_contact_details.py", line 87, in email
    return self._email
AttributeError: 'GetExtendedContactDetails' object has no attribute '_email'

I get the same error for all other and attributes that you would expect from the GetExtendedContactDetails object(e.g. list_ids, attributes, 'id').

The API itself seems to return the correct data but this library doesn't include it in the returned object.

QuillyT commented 5 years ago

Oh I think I found the problem.

The __init__() in GetExtendedContactDetails is not calling super() so it's not instantiating any of the attributes in the parent class.

aakanksha-sib commented 5 years ago

Hi @QuillyT ,

We are working on the same. We will get back to you shortly once the issue is fixed from our end.

Thanks, Aakanksha Sendinblue

aakanksha-sib commented 5 years ago

hi @QuillyT , The issue has been fixed. Please move to v6.0.0

Thanks!