-
-
Save arnaudbreton/f09ac2dcb1316790a5336756556e5f72 to your computer and use it in GitHub Desktop.
Send API v3.1 stable blogpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Messages": [ | |
{ | |
"Errors": [ | |
{ | |
"ErrorIdentifier": "c04ac4d7-1ebd-4c26-a663-ef304578aef7", | |
"ErrorCode": "send-0008", | |
"StatusCode": 403, | |
"ErrorMessage": "\"i-am-not-a-valid-sender@mailjet.com\" is not an authorized sender email address for your account.", | |
"ErrorRelatedTo": [ | |
"From" | |
] | |
} | |
], | |
"Status": "error" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Messages": [ | |
{ | |
"Status": "success", | |
"CustomID": "sapi_v31_demo", | |
"To": [ | |
{ | |
"Email": "abreton@mailjet.com", | |
"MessageUUID": "5d4710f5-9aff-4ff8-9d7e-1f0cf9125019", | |
"MessageID": 70368744188491213, | |
"MessageHref": "https://api.mailjet.com/v3/REST/message/70368744188491213" | |
} | |
], | |
"Cc": [], | |
"Bcc": [] | |
}, | |
{ | |
"Status": "success", | |
"CustomID": "sapi_v31_demo", | |
"To": [ | |
{ | |
"Email": "abreton@mailjet.com", | |
"MessageUUID": "0cdb05d9-83bc-40a6-acd1-f42f790eb68d", | |
"MessageID": 70368744188491214, | |
"MessageHref": "https://api.mailjet.com/v3/REST/message/70368744188491214" | |
} | |
], | |
"Cc": [], | |
"Bcc": [] | |
}, | |
{ | |
"Errors": [ | |
{ | |
"ErrorIdentifier": "835927d2-421a-43a0-a482-dc31ee49bf8e", | |
"ErrorCode": "send-0008", | |
"StatusCode": 403, | |
"ErrorMessage": "\"i-am-not-a-valid-sender@mailjet.com\" is not an authorized sender email address for your account.", | |
"ErrorRelatedTo": [ | |
"From" | |
] | |
} | |
], | |
"Status": "error" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s \ | |
-X POST \ | |
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \ | |
https://api.mailjet.com/v3.1/send \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"Messages":[ | |
{ | |
"From": { | |
"Email": "pilot@mailjet.com", | |
"Name": "Mailjet Pilot" | |
}, | |
"To": [ | |
{ | |
"Email": "passenger1@mailjet.com", | |
"Name": "passenger 1" | |
} | |
], | |
"Subject": "Your email flight plan!", | |
"TextPart": "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!", | |
"HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"http://www.mailjet.com\">Mailjet</a>!</h3><br />May the delivery force be with you!", | |
"URLTags": "param1=1¶m2=2" | |
} | |
] | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment