nylas/nylas-python

Adding the tracking attribute causes Internal Server Error.

Closed this issue · 1 comments

This is my code:

from nylas import APIClient

       nylas = APIClient(
           client_id,
           client_secret,
           access_token
       )
       draft = nylas.drafts.create()
       draft.subject = "With Love, from Nylas"
       draft.body = "This email was sent using the Nylas Email API. Visit https://nylas.com for details."
       draft.to = [{'name': 'My Nylas Friend', 'email': 'abcd@gmail.com'}]
       # draft.tracking = {'links': 'false', 'opens': "true", 'thread_replies': 'false', 'payload': 'python sdk open tracking test'}
       draft.send()

This works perfectly fine and an email is sent.

However, the moment I uncomment the draft.tracking line, I receive the following error:

 File "//nylas/client/restful_models.py", line 465, in send
    msg = self.api._create_resource(Send, data)
  File "//nylas/client/client.py", line 353, in _create_resource
    result = _validate(response).json()
  File "//nylas/client/client.py", line 54, in _validate
    response.raise_for_status()
  File "//requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: https://api.nylas.com/send/

I'll try sending it via curl later on and report back, but this error from the Python SDK is happening despite this commit: d7a42dd

@harisibrahimkv this appears to be an issue with the API, not the SDK. Please reach out to support@nylas.com to get help.