Hi
I'm trying to automate sending invoices via the API by posting to the following URL:
https://api.businesscentral.dynamics.com/v1.0/{tenantId}/api/v2.0/companies({companyId})/salesInvoices({salesInvoiceId})/Microsoft.NAV.Send
This executes successfully and returns "204 No Content", however no email is produced.
When reviewing the "Job Queue Log Entries" I can see an error relating to the API call:
The error message says:
You are not authorized to access this resource: https://graph.microsoft.com/.default. Contact your system administrator.
I think the problem is that the App Registration does not have the correct permissions to send the email via the shared mailbox configured. I have granted several Microsoft.Graph permissions including Application.ReadWrite.All and Mail.Send and still have not had any success, which makes me think there could be a configuration in BC I need to do.
If anyone else has encountered this and come up with a solution please let me know? Thank you