- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When trying to send email through the VIYA REST api from a shell script I get the following message:
{"version":2,"httpStatusCode":400,"message":"The request body was missing or invalid.",
"details":["path: /mail/messages","correlator: 70862b93-1626-4763-ad6d-b7d5d6e1032e"]}
This is how I issue the request:
curl -s -k -X POST "$base_url/mail/messages" \
-H "Authorization: Bearer $IDTOKEN" \
-H 'Content-Type: application/vnd.sas.mail+json' \
-d '{
"to":"me@email.adres",
"subject":"testmail door Gerold van viya LTEST",
"message":"Deze mail wordt verstuurd met de VIYA REST API"
}'
I can't find documentation on the data part of the request. Documetation only mentions to have the three fields. I tried making the "message" field a list but that doesn't work either.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
{
"to": [
{
"address": "user@example.com",
"personal": "Example User"
}
],
"from": {
"address": "from@example.com"
},
"subject": "Subject goes here",
"htmlMessage": "<html><b>Note:</b>This is an HTML email.</html>"
}
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
{
"to": [
{
"address": "user@example.com",
"personal": "Example User"
}
],
"from": {
"address": "from@example.com"
},
"subject": "Subject goes here",
"htmlMessage": "<html><b>Note:</b>This is an HTML email.</html>"
}
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is all this documented anywhere?
Thanks again,
Gérold
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Mr. Gwooton,
how can i use this with starttls, the example is not working with starttls eventhough we have mail.smtp.starttls.enable : true in configuration.
Example error output :
{"version":2,"httpStatusCode":400,"errorCode":11104,"message":"Couldn't connect to host, port: OURSMTPSERVER, 25; timeout -1","details":["Caused by gomail: could not send email 1: 530 #5.7.0 Must issue a STARTTLS command first","path: /mail/messages","correlator: f965315d-08e9-4af1-bf19-e4227f7fda74"]}sh-4.4$
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes we did this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
even if I mail from studio, with starttls it works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg,
this is what I sended to support today.
Dear Support,
eureka !
I found a workaround by accident .
I saw that we have DEBUG=true as optional parameter.
I added DEBUG=true and the pod started again.
Then today I had a brainwave.
I changed DEBUG=true in ...... mail.smtp.starttls.enable=true.
IT WORKS !!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Not optional but properties.
properties:
mail.smtp.starttls.enable=true
(Deprecated) Optional properties set on the remote mail server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So you modified the mail.debug=false set by default in the deprecated properties field (that had been changed to true in your case) to mail.smtp.starttls.enable=true and it picked it up?
Greg Wootton | Principal Systems Technical Support Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greg, exactly !
Regards.
Dik
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Any idea how to send with attachments, using this same method