-
Hello, (body jsonnet has the default value) courier:
delivery_strategy: http
http:
request_config:
url: https://api.sendgrid.com/v3/mail/send
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7CiAgcmVjaXBpZW50OiBjdHguUmVjaXBpZW50LAogIHRlbXBsYXRlX3R5cGU6IGN0eC5UZW1wbGF0ZVR5cGUsCiAgdG86IGlmICJUZW1wbGF0ZURhdGEiIGluIGN0eCAmJiAiVG8iIGluIGN0eC5UZW1wbGF0ZURhdGEgdGhlbiBjdHguVGVtcGxhdGVEYXRhLlRvIGVsc2UgbnVsbCwKICByZWNvdmVyeV9jb2RlOiBpZiAiVGVtcGxhdGVEYXRhIiBpbiBjdHggJiYgIlJlY292ZXJ5Q29kZSIgaW4gY3R4LlRlbXBsYXRlRGF0YSB0aGVuIGN0eC5UZW1wbGF0ZURhdGEuUmVjb3ZlcnlDb2RlIGVsc2UgbnVsbCwKICByZWNvdmVyeV91cmw6IGlmICJUZW1wbGF0ZURhdGEiIGluIGN0eCAmJiAiUmVjb3ZlcnlVUkwiIGluIGN0eC5UZW1wbGF0ZURhdGEgdGhlbiBjdHguVGVtcGxhdGVEYXRhLlJlY292ZXJ5VVJMIGVsc2UgbnVsbCwKICB2ZXJpZmljYXRpb25fdXJsOiBpZiAiVGVtcGxhdGVEYXRhIiBpbiBjdHggJiYgIlZlcmlmaWNhdGlvblVSTCIgaW4gY3R4LlRlbXBsYXRlRGF0YSB0aGVuIGN0eC5UZW1wbGF0ZURhdGEuVmVyaWZpY2F0aW9uVVJMIGVsc2UgbnVsbCwKICB2ZXJpZmljYXRpb25fY29kZTogaWYgIlRlbXBsYXRlRGF0YSIgaW4gY3R4ICYmICJWZXJpZmljYXRpb25Db2RlIiBpbiBjdHguVGVtcGxhdGVEYXRhIHRoZW4gY3R4LlRlbXBsYXRlRGF0YS5WZXJpZmljYXRpb25Db2RlIGVsc2UgbnVsbCwKICBzdWJqZWN0OiBjdHguU3ViamVjdCwKICBib2R5OiBjdHguQm9keQp9Cg==
headers:
'Content-Type': 'application/json'
# 'Authorization': 'Bearer SENDGRID_API_KEY'
auth:
type: api_key
config:
name: Authorization
value: Bearer SENDGRID_API_KEY
in: header I kept getting a 401 response from sendgrid, for me is unclear if the name of the API key under Any help is appreciated, many thanks!. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hello @a-damian It seems like you're on the right track with your configuration. However, there are no docs on configuring the courier for HTTP delivery strategy with SendGrid, so I am not sure what the issue is. The |
Beta Was this translation helpful? Give feedback.
Hello @vinckr
Thanks for the response, you were right, the config in place was configured correctly, I was getting 400 or 401 status codes from SendGrid since I was using the default body
jsonnet
, to solve the issue I adjusted thejsonnet
file to match SendGrid specifications.Here is the SendGrid API V3 docs in case some one need them. docs
Finally here is an example of how my config ended: