401 Authorization Required when using /interop/rest/v2/mails/send
Using groovy to send email in business rule:
HttpResponse<String> jsonResponse = operation.application.getConnection("SendMail").post('/interop/rest/v2/mails/send').header("Content-Type", "application/json").body(payload).asString();
When I use this I get the 401 error
When I use this, I do not.
HttpResponse<String> emailResponse = operation.application.getConnection("SendMail")
.post("/interop/rest/v2/mails/send")
.header("Authorization", "Basic " + encodedAuth)
.header("Content-Type", "application/json")
.body(payload)
.asString();
Why is this happening? I would prefer to use the credentials in the SendMail connection instead of hard coding in the script which is what this is doing:
.header("Authorization", "Basic " + encodedAuth)
0