Share via

Mail Webhook Subscription doesn't work

Claudio Errecart 20 Reputation points
2025-11-25T18:41:43.9533333+00:00

Hi,

I am working on Oracle Integration Cloud Gen3 with an integration whose trigger is whenever an email arrives at an Outlook (or Exchange) mailbox. The goal is to capture and process the attachment from the incoming email. I'm wondering if I must use a business. account or I can do some test using a personal account? When I try to subscribe I get the following error:

Request Payload
{

"changeType" : "updated",

"notificationUrl" : "https://n3565rpingkfb5iurmlduqtw4a.apigateway.us-phoenix-1.oci.customer-oci.com/notificationClient/notify",

"resource" : "/users/******@outlook.com/mailFolders('inbox')/messages",

"expirationDateTime" : "2025-11-28T06:36:45.301Z",

"clientState" : "secretClientValue",

"latestSupportedTlsVersion" : "v1_2"

}

Error Message

CloudInvocationException [ Fault Details :

<ns0:APIInvocationError xmlns:ns0="http://xmlns.oracle.com/cloud/generic/rest/fault/REST/CreateMailWebhookSubscription">

<ns0:type />

<ns0:title />

<ns0:detail />

<ns0:errorCode />

ns0:errorDetails

<ns0:type>http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2</ns0:type>

<ns0:title>Unauthorized</ns0:title>

<ns0:errorCode>401</ns0:errorCode>

<ns0:errorPath>&lt;![CDATA[InboundJaxrsResponse{context=ClientResponse{method=POST, uri=https://graph.microsoft.com/v1.0/subscriptions, status=401, reason=Unauthorized}}]]&gt;</ns0:errorPath>

<ns0:instance>&lt;![CDATA[{"error":{"code":"ExtensionError","message":"Operation: Create; Exception: [Status Code: Unauthorized; Reason: ]","innerError":{"date":"2025-11-25T11:57:05","request-id":"9576c42f-b05c-4a83-b835-6896cba465b3","client-request-id":"9576c42f-b05c-4a83-b835-6896cba465b3"}}}.The 401 error message is usually returned by services that requires user credentials. So if you have got this error then it pobably means you entered an invalid username or password. It may also be that one of the intermediaries (proxy, LBR) could be returning this code. Please note, test connection doesn't validate the credentials and even if it is successful, it may not be sufficient. As the parameters defined within the connection page are used to call the target endpoint REST API, which is configured as part of endpoint configuration, it is strongly recommended that the endpoint configuration that uses this connection is tested. Re-check or re-configure the connection with the correct set of credentials. Test connection is only used to validate the parameters defined within the connection page. 1) This includes REST API definition - we try to retrieve the API Definition to understand the resources within. 2) API Base URL - We ensure that the base URL is reachable and can be trusted by OIC. 3) OAuth Configuration - We obtain the access tokens and try to refresh the access token. ]]&gt;</ns0:instance>

</ns0:errorDetails>

</ns0:APIInvocationError> ]

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

Answer accepted by question author

AI answer

2025-11-25T18:41:59.7566667+00:00

To successfully create a webhook subscription for an Outlook or Exchange mailbox, you typically need to use a Microsoft 365 account rather than a personal Outlook account. The error message you are encountering, which indicates an "Unauthorized" status, suggests that the credentials being used may not have the necessary permissions or that the account is not valid for the operation you are trying to perform.

Here are some steps to troubleshoot the issue:

  1. Account Type: Ensure that you are using a Microsoft 365 business account. Personal accounts may not support the required API operations.
  2. Credentials: Double-check the username and password you are using. Make sure they are correct and that the account has the necessary permissions to access the mailbox and create subscriptions.
  3. API Permissions: Verify that the application has the correct permissions set in Azure AD to access the mailbox and create subscriptions. You may need to grant additional permissions for the Microsoft Graph API.
  4. Test Connection: Note that the test connection feature may not validate all credentials properly. Ensure that the connection is configured correctly and test it against the actual API endpoint.
  5. OAuth Configuration: If you are using OAuth for authentication, ensure that the access tokens are being obtained correctly and that they are valid for the operations you are trying to perform.

If you continue to face issues, consider reaching out to your administrator or support for further assistance regarding the account and permissions.

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.