Skip to content

UnauthorizedError: HTTP Error 401: Unauthorized error appears when sending e-mail #561

Description

@utkusen

Issue Summary

I can send e-mails with my api key by using curl with following examples: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html

But when I try to send an e-mail with "Hello Mail/With Mail Helper Class" code, I get following error:

Traceback (most recent call last):
  File "gridsend.py", line 11, in <module>
    response = sg.client.mail.send.post(request_body=mail.get())
  File "/usr/local/lib/python3.6/site-packages/python_http_client/client.py", line 227, in http_request
    return Response(self._make_request(opener, request))
  File "/usr/local/lib/python3.6/site-packages/python_http_client/client.py", line 161, in _make_request
    raise exc
python_http_client.exceptions.UnauthorizedError: HTTP Error 401: Unauthorized

Technical details:

  • sendgrid-python Version: 5.3.0
  • Python Version: 3.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions