How can I get resource ID when New Email Created to my Outlook Account

Manik Mia 20 Reputation points
2024-02-20T14:43:49.3666667+00:00

In my laravel application I want when somebody send any mail to my microsoft outlook account It will send a post notification so that I can understand somebody mailed me. That's why I am subscribing microsoft webhook notfication bellow my php code.

$subscriptionData = [    'changeType' => 'created',    'notificationUrl' => route('microsoft.email.webhook'),    'resource' =>  "/me/mailfolders('inbox')/messages",    'expirationDateTime' => Carbon::now()->addMinutes(10060)->toAtomString(),];$subscriptionResponse = Http::withToken($accessToken)->post('https://graph.microsoft.com/v1.0/subscriptions', $subscriptionData);

This code is totally correct. Its subscribing microsoft webhook notification and its send post notification to my laravel application. And Request Data is

{"subscriptionId":"2b274e49-04e7-41c5-8247-cc344e4531c2","subscriptionExpirationDateTime":"2024-02-27T13:40:41+00:00","changeType":"created","resource":"Users/1371f930512d501f/Messages/AQMkADAwATMwMAItNmM0OS05Yzc5LTAwAi0wMAoARgAAA62kjnAyJSBHg0YiJd35H5EHAJb_1YK2wNxDu6S7OE5bXAMAAAIBDAAAAJb_1YK2wNxDu6S7OE5bXAMAAAAl3HN9AAAA","resourceData":{"@odata.type":"#Microsoft.Graph.Message","@odata.id":"Users/1371f930512d501f/Messages/AQMkADAwATMwMAItNmM0OS05Yzc5LTAwAi0wMAoARgAAA62kjnAyJSBHg0YiJd35H5EHAJb_1YK2wNxDu6S7OE5bXAMAAAIBDAAAAJb_1YK2wNxDu6S7OE5bXAMAAAAl3HN9AAAA","@odata.etag":"W/\"CQAAABYAAACW/tWCtsDcQ7ukuzhOW1wDAAAl2KgF\"","id":"AQMkADAwATMwMAItNmM0OS05Yzc5LTAwAi0wMAoARgAAA62kjnAyJSBHg0YiJd35H5EHAJb_1YK2wNxDu6S7OE5bXAMAAAIBDAAAAJb_1YK2wNxDu6S7OE5bXAMAAAAl3HN9AAAA"},"clientState":null,"tenantId":null}

Sometimes I need Which resource has created for this webhook post request. How can I find resource of this post request sometimes I need full mail of post request.

What can I do? Please Help me.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Your answer

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