Microsoft Tech Community Live:  Microsoft Teams Edition
November 09, 2021, 08:00 AM - 12:00 PM (PST)

MS Graph setPresence problems

%3CLINGO-SUB%20id%3D%22lingo-sub-2748341%22%20slang%3D%22de-DE%22%3EMS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2748341%22%20slang%3D%22de-DE%22%3E%3CP%3EHi%20everyone%2C%20we%20have%20two%20issues%20with%20MS%20Graph%20setPresence%3A%20%3CBR%20%2F%3E%201.%20Every%20time%20I%20do%20api%20call%20with%20a%20valid%20availability%2Factivity%2C%20I%20get%20200%20OK%20but%20I%20don't%20see%20the%20status%20actually%20changing%20in%20the%20Teams%20App.%20What's%20funny%2C%20I%20can%20see%20it%20being%20changed%20if%20I%20am%20logged%20as%20another%20user%20and%20just%20observe%20the%20user%20I%20change%20the%20status%20for.%20The%20status%20updates%20only%20when%20I%20restart%20teams%20app.%3C%2FP%3E%3CP%3E2.%20Although%20I%20set%20the%20Presence%20State%20to%20%22Busy%20%E2%80%93%20InACall%22%2C%20incoming%20calls%20are%20not%20rejected.%20And%20yes%2C%20Busy%20on%20Busy%20(Busy%20Options)%20is%20activated.%20So%20if%20I%20have%20a%20real%20Teams%20call%20a%20new%20incoming%20call%20is%20rejected.%3CBR%20%2F%3EAny%20ideas%20how%20to%20resolve%20these%20two%20issues%3F%3CBR%20%2F%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2748341%22%20slang%3D%22de-DE%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2756918%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2756918%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1155243%22%20target%3D%22_blank%22%3E%40relkniw%3C%2FA%3E%26nbsp%3B-%20We%20tried%20to%20repro%20the%20issue.%20We%20see%20that%20the%20status%20is%20getting%20updated%20right%20away%20without%20restarting%20the%20app.%20We%20are%20looking%20into%202nd%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2759802%22%20slang%3D%22de-DE%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2759802%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1092848%22%20target%3D%22_blank%22%3E%40Meghana-MSFT%3C%2FA%3E-%20We%20are%20using%20the%20nuget%20Microsoft.Graph%20SDK%20with%20c%23%20in%20VisualStudio.%20What%20is%20the%20best%20way%20to%20see%20the%20request%20and%20response%20headers%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2760238%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2760238%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20described%20here%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fpresence-setpresence%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fpresence-setpresence%3C%2FA%3E%3A%3CBR%20%2F%3EImportant%3CBR%20%2F%3EProvide%20the%20ID%20of%20the%20application%20as%20sessionId%20in%20the%20request.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2774105%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2774105%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1155243%22%20target%3D%22_blank%22%3E%40relkniw%3C%2FA%3E%26nbsp%3B-%3C%2FP%3E%0A%3CP%3E1.%20Please%20put%20a%20debugger%20at%20catch%20block%20and%20look%20for%20the%20message.%20You%20will%20find%20the%26nbsp%3Brequest-ids%20in%20it.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Etry%7B%0Aawait%20graphClient.Users%5B%22%7Buser-id%7D%22%5D.Presence%0A%20.SetPresence(sessionId%2Cavailability%2Cactivity%2CexpirationDuration)%0A%20.Request()%0A%20.PostAsync()%3B%0A%7D%0Acatch(Exception%20e)%0A%7B%0A%20%20Console.WriteLine(e.Message)%3B%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B2.%20For%20the%202nd%20issue%2C%20we%20tried%20in%20below%20ways%3C%2FP%3E%0A%3COL%20class%3D%22lia-list-style-type-lower-roman%22%3E%0A%3CLI%3EWhen%202%20people%20were%20in%20actual%20Teams%20call%2C%20a%20new%20incoming%20call%20is%20not%20rejected.%3C%2FLI%3E%0A%3CLI%3EWhen%20the%20%3CSPAN%3EPresence%20State%20is%20set%20to%20%22Busy%20%E2%80%93%20InACall%22%2C%26nbsp%3Ba%20new%20incoming%20call%20is%20not%20rejected.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3ECould%20you%20please%20try%26nbsp%3B%20and%20confirm%20what%20is%20happening%20in%20your%20case%3F%20By%26nbsp%3Breal%20Teams%20call%20do%20you%20mean%20an%20actual%20call%20between%202%20people%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CP%3E%3CSPAN%3EThanks%2C%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%3E%3CSPAN%3EMeghana%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3E--------------------------------------------------------------------------------------------------------------------------------------------%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20the%20response%20is%20helpful%2C%20please%20click%20%22**Mark%20as%20Best%20Response**%22%20and%20like%20it.%20You%20can%20share%20your%20feedback%20via%20%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Faka.ms%2Fdevsupportfeedback)%22%20href%3D%22https%3A%2F%2Faka.ms%2FDevSupportFeedback)%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3EMicrosoft%20Teams%20Developer%20Feedback%3C%2FA%3E%20link.%20Click%20%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Faka.ms%2Fdevcommunityescalationform%22%20href%3D%22https%3A%2F%2Faka.ms%2FDevCommunityEscalationForm%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%22%3Ehere%3C%2FA%3E%20to%20escalate.%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2777242%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2777242%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1092848%22%20target%3D%22_blank%22%3E%40Meghana-MSFT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Yes%20I%20mean%20a%20Call%20between%20two%20people.%20Have%20you%20configured%20the%20%22Busy%20on%20busy%20when%20in%20a%20call%22%20as%20%22Enabled%22.%20You%20find%20that%20setting%20in%20the%20Teams%20Admin%20-%26gt%3B%20Voice%20-%26gt%3B%20Calling%20policies%20-%26gt%3B%20Global.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22relkniw_0-1632379355110.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312324iBBDE7C4A4DA0F6A4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22relkniw_0-1632379355110.png%22%20alt%3D%22relkniw_0-1632379355110.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIf%20this%20is%20configured%2C%20a%20new%20incomming%20call%20will%20be%20rejected%20if%202%20people%20were%20in%20actual%20Teams%20call.%20But%20not%20if%20the%20Presence%20State%20is%20set%20to%20%22Busy%20%E2%80%93%20InACall%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2778898%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2778898%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1155243%22%20target%3D%22_blank%22%3E%40relkniw%3C%2FA%3E%26nbsp%3B-%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECould%20you%20please%20share%20the%20ids%20as%20shown%20in%20below%20screenshot.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MeghanaMSFT_1-1632410282202.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312441i3503D2826BA9B55F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MeghanaMSFT_1-1632410282202.png%22%20alt%3D%22MeghanaMSFT_1-1632410282202.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20We%20were%20able%20to%20repro%20the%20issue%2C%20We%20are%20checking%20it%20internally.%20we%20will%20let%20you%20know.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2760186%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2760186%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1155243%22%20target%3D%22_blank%22%3E%40relkniw%3C%2FA%3E%26nbsp%3BHow%20do%20you%20find%20out%20the%20sessionId%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2791326%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2791326%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1092848%22%20target%3D%22_blank%22%3E%40Meghana-MSFT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20We%20do%20not%20get%20an%20exception.%3CBR%20%2F%3EThe%20Problem%20is%3A%3C%2FP%3E%3CP%3E-%20Call%20SetPresence%20with%20Busy%20-%20InACall%20for%20Gerd%20Winkler%20via%20MS%20Garph%20API%3C%2FP%3E%3CP%3E-%20My%20Status%20in%20the%20header%20of%20my%20MS%20Teams%20Client%20will%20not%20change%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22relkniw_0-1632826796171.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F313318i17ACD3AF97D0B414%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22relkniw_0-1632826796171.png%22%20alt%3D%22relkniw_0-1632826796171.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E-%20But%20my%20status%20in%20the%20contact%20list%20of%20another%20MS%20Teams%20client%20will%20change%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Eimmediately%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22relkniw_1-1632826844512.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F313319i1A7A5429D58215C1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22relkniw_1-1632826844512.png%22%20alt%3D%22relkniw_1-1632826844512.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2777462%22%20slang%3D%22en-US%22%3ERe%3A%20MS%20Graph%20setPresence%20problems%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2777462%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1092848%22%20target%3D%22_blank%22%3E%40Meghana-MSFT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Do%20you%20mean%20that%3F%20Or%20do%20you%20need%20a%20special%20value%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22relkniw_2-1632385024363.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312341i544E74A60A72B84E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22relkniw_2-1632385024363.png%22%20alt%3D%22relkniw_2-1632385024363.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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.

10 Replies

@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.

@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?

@relkniw How do you find out the sessionId?

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.

@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

  1. When 2 people were in actual Teams call, a new incoming call is not rejected.
  2. 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.

@Meghana-MSFT 

2. Yes I mean a Call between two people. Have you configured the "Busy on busy when in a call" as "Enabled". You find that setting in the Teams Admin -> Voice -> Calling policies -> Global.

relkniw_0-1632379355110.png

If this is configured, a new incomming call will be rejected if 2 people were in actual Teams call. But not if the Presence State is set to "Busy – InACall".

@Meghana-MSFT 

1. Do you mean that? Or do you need a special value?

relkniw_2-1632385024363.png

 

@relkniw -

  1. Could you please share the ids as shown in below screenshot. 

MeghanaMSFT_1-1632410282202.png

 

2. We were able to repro the issue, We are checking it internally. we will let you know.

@Meghana-MSFT 

1. We do not get an exception.
The Problem is:

- Call SetPresence with Busy - InACall for Gerd Winkler via MS Garph API

- My Status in the header of my MS Teams Client will not change:

relkniw_0-1632826796171.png

- But my status in the contact list of another MS Teams client will change immediately:

 

relkniw_1-1632826844512.png

 

@relkniw 

  1. I tested this issue using postman and it was working fine. Later I tried it using C# and was able to repro the issue. We have raised a bug for the same and the concerned team is looking into it.
  2. We were able to repro this issue as well. We have raised a bug for the same and the concerned team is looking into it.

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.