question

Ingo-8258 avatar image
0 Votes"
Ingo-8258 asked Ingo-8258 edited

lifecycle notifications (/communication/CallRecords) doesn't work for me

I registered a subscription for callrecord.

I tried many, I started with a locally C# app with ngrok and then I used an Azure function with nodejs. Creating the subscription locally without lifecycle notification works fine, creating a subscription with an Azure function with nodeJS works fine too with both urls (notification & lifecycle).

For the post call I used the following JSON:

 {
    "resource": "communications/callRecords",,
    "changeType": "created",
    "clientState": "xyz",
    "notificationUrl": "https://<domain>/api/notification",
    "lifecycleNotificationUrl": "https://<domain>/api/lifecylcenotification",
    "expirationDateTime": "2021-08-29T16:36:56.1624377Z",
 } 

The registered Azure function for both url's uses the following code:

 module.exports = async function (context, req) {
     context.log('Executing Webhook endpoint...');
    
     // Validate the subscription creation
     if (req.query.validationToken) {
         context.log('Validating new subscription...');
         context.log('Validation token:');
         context.log(req.query.validationToken);
         context.res = {
             headers: {
                 'Content-Type': 'text/plain'
             },
             body: req.query.validationToken
         };
     }
     else {
         context.log('Received new notification...');
         context.log('Notification: ');
         context.log(JSON.stringify(req.body));
         context.res = { body: "" };
     }
 };

I tried many and spend many time but in no case I got a lifecycle notification but it was everytime successfully registered for it.

Can aynone help or tell me what could be wrong?

microsoft-graph-notifications
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers