I need to send via email a pin from an android app to a mail group using Outlook Mail REST API. How can I achieve this? I can't find anything about groups on the documentation.
I want to avoid to store the admin users in a static config file and POST a request to "https://outlook.office.com/api/v2.0/me/sendmail" with a JSON content like:
{
"Message": {
"Subject": "ADMIN PIN FOR ANDROID APP",
"Body": {
"ContentType": "Text",
"Content": "The secret pin is: 12345"
},
"ToRecipients": [ // ( list generated from config file )
{
"EmailAddress": {
"Address": "[email protected]"
}
},
{
"EmailAddress": {
"Address": "[email protected]"
}
}
],
"Attachments": [
{
"@odata.type": "#Microsoft.OutlookServices.FileAttachment",
"Name": "menu.txt",
"ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}
]
},
"SaveToSentItems": "false"
}
Thanks