Forum Discussion
MS Graph setPresence problems
Hi everyone, we have two issues with MS Graph setPresence:
1. Every time I do api call with a valid availability/activity, I get 200 OK but I don’t see the status actually changing in the Teams App. What’s funny, I can see it being changed if I am logged as another user and just observe the user I change the status for. The status updates only when I restart teams app.
2. Although I set the Presence State to “Busy – InACall”, incoming calls are not rejected. And yes, Busy on Busy (Busy Options) is activated. So if I have a real Teams call a new incoming call is rejected.
Any ideas how to resolve these two issues?
Thanks.
- Meghana-MSFTMicrosoft
relkniw - We tried to repro the issue. For 1st issue We see the status is getting updated right away without restarting the app. Could you please share the request and response headers for the request where you see the status is not getting updated? Please make sure you have removed any PII. We are looking into 2nd issue.
- relkniwBrass Contributor
Meghana-MSFT- We are using the nuget Microsoft.Graph SDK with c# in VisualStudio. What is the best way to see the request and response headers?
- Meghana-MSFTMicrosoft
relkniw -
1. Please put a debugger at catch block and look for the message. You will find the request-ids in it.
try{ await graphClient.Users["{user-id}"].Presence .SetPresence(sessionId,availability,activity,expirationDuration) .Request() .PostAsync(); } catch(Exception e) { Console.WriteLine(e.Message); }
2. For the 2nd issue, we tried in below ways
- When 2 people were in actual Teams call, a new incoming call is not rejected.
- When the Presence State is set to "Busy – InACall", a new incoming call is not rejected.
Could you please try and confirm what is happening in your case? By real Teams call do you mean an actual call between 2 people?
Thanks,
Meghana--------------------------------------------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- relkniwBrass Contributor
As described here https://docs.microsoft.com/en-us/graph/api/presence-setpresence:
Important
Provide the ID of the application as sessionId in the request.