I have to post it again as I did not get any answers on me prev post.
I Am unable to create a presence session for the user for customized expirationDuration
parameter. I have tried to set its value as 'PT1H', 'PT4H', 'PT50M', but nothing is working, it seems like MS Graph always considering a default value for expirationDuration and app behaving as follows:
"Main application sets the presence session as Available/Available
, the state would change to Available/AvailableInactive
in 5 minutes with the first timeout, then Away/Away
in another 5 minutes with the second timeout.". Creating session as follows:
const setPresence = { sessionId: xxxx-xxxx-xxxx-xxxx, // registered azure app id availability: 'Available', activity: 'Available', expirationDuration: 'PT1H', }; const res = await CommonGraphClient.myInstance.api(/users/${userId}/presence/setPresence
).post(setPresence);
Once session is created, we are calling setUserPreferredPresence to set the status of the user. User can select their desired status from a drop down from the main UI as
'Available','Busy','DoNotDisturb','BeRightBack','Away', 'OffWork',
const presence= {
sessionId: xxxx-xxxx-xxxx-xxxx, // registered azure app id,
availability: userPresence, // presence status selected from UI
activity: xxxx,//'Available','Busy','DoNotDisturb','BeRightBack','Away', 'OffWork'
, expirationDuration: 'PT1H', };
const res = await CommonGraphClient.myInstance.api(/users/${userId}/presence/setUserPreferredPresence
).post(presence);
But once the session expires, User status is set to 'Away" and now it cannot be changed to any other status by user from Combo.