Search code examples
c#sendgrid-api-v3

SendGrid V3 connect using username and password


How can I use SendGrid.SendGridClient to connect using username and password.

There are lot of examples given using how to connect with API Key.

But if I want to connect with username and password. How do i achieve that ?

I am using sendgrid 9.10.0

Any help ?


Solution

  • As per the docs, an API key is the recommended approach for the V3 API, it doesn't explicitly state it doesn't support Basic authentication so if you could try setting the Authorization header directly (headers can be passed into the client as options). However, I'd strongly advise just using an API key, it's a much more secure mechanism.

    FWIW Basic authentication is considered legacy and should only be used for V2.