Inconsistent behaviors when retrieving channel members with graph API

%3CLINGO-SUB%20id%3D%22lingo-sub-1093606%22%20slang%3D%22en-US%22%3EInconsistent%20behaviors%20when%20retrieving%20channel%20members%20with%20graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1093606%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20trying%20to%20get%20members%20in%20a%20private%20channel%20when%20I%20noticed%20that%20one%20of%20three%20results%20may%20appear%20when%20I%20call%20(http%20GET)%20the%20api%3A%3C%2FP%3E%3CPRE%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fteams%2F%7Bid%7D%2Fchannels%2F%7Bid%7D%2Fmembers%3C%2FPRE%3E%3CP%3E1.%20An%20error%2C%20possibly%20being%20%22Unauthorized%22%20or%20%22Bad%20Gateway%22%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%22error%22%3A%20%7B%0A%20%20%20%20%22code%22%3A%20%22Unauthorized%22%2C%0A%20%20%20%20%22message%22%3A%20%22Failed%20to%20execute%20Aad%20backend%20request%20GetTenantSubscribedSkusRequest.%20Request%20Url%3A%20https%3A%2F%2Fgraph.windows.net%2F8146c981-eb5d-4f42-a507-6ba4554be38a%2FsubscribedSkus%3Fapi-version%3D1.6%2C%20Request%20Method%3A%20GET%2C%20Response%20Status%20Code%3A%20Unauthorized%2C%20Response%20Headers%3A%20ocp-aad-diagnostics-server-name%3A%20WqKhWXvl1okXb47qljo0lPbR3WueJ7PneT8ez1L9elM%3D%5Cr%5Cnrequest-id%3A%2093b4d095-07e5-4297-8218-5f72278fc5f1%5Cr%5Cnclient-request-id%3A%2030a0f9a7-db67-431e-bb99-b624516b9f8a%5Cr%5CnStrict-Transport-Security%3A%20max-age%3D31536000%3B%20includeSubDomains%5Cr%5CnDate%3A%20Tue%2C%2010%20Dec%202019%2003%3A10%3A07%20GMT%5Cr%5Cn%2C%20Reason%20Phrase%3A%20Unauthorized%22%2C%0A%20%20%20%20%22innerError%22%3A%20%7B%0A%20%20%20%20%20%20%22request-id%22%3A%20%22ef0e0908-c47a-4a4d-9d76-363630a390c1%22%2C%0A%20%20%20%20%20%20%22date%22%3A%20%222019-12-10T03%3A10%3A08%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3C%2FPRE%3E%3CP%3E2.%20Returns%20with%20a%20incomplete%20member%20list%2C%20some%20of%20the%20members%20are%20not%20included.%3C%2FP%3E%3CP%3E3.%20Returns%20with%20a%20full%20member%20list.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20noticed%20that%20whenever%20I%20login%20the%20graph%20api%20explorer%20with%20my%20test%20account%2C%20the%20subsequent%20api%20calls%20in%20my%20program%20will%20no%20longer%20error%20out%20although%20being%20no%20change%20in%20code%20or%20request%20context%20(same%20token%2C%20same%20channel)%2C%20Until%20some%20time%20later%20(probably%20a%20day%20or%20more)%2C%20this%20may%20start%20to%20show%20up%20again.%3C%2FP%3E%3CP%3EMy%20test%20code%20(c%23)%20was%20rather%20simple%2C%20basically%20a%26nbsp%3Bhttp%20client%20GET%20request%20with%20a%20pre-requested%20string%20token%20and%20an%20endpoint%20url%2C%20and%20my%20test%20azure%20app%20was%20using%20%22application%22%20permission%2C%20instead%20of%20%22delegate%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20my%20question%20is%2C%20what%20could%20be%20causing%20the%20api%20call%20to%20behave%20like%20in%20case%201%20or%202%2C%20instead%20of%203%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1093606%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1096319%22%20slang%3D%22en-US%22%3ERe%3A%20Inconsistent%20behaviors%20when%20retrieving%20channel%20members%20with%20graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1096319%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F507316%22%20target%3D%22_blank%22%3E%40ck1521%3C%2FA%3E%2C%26nbsp%3BI%20was%20unable%20to%20replicate%20this%20scenario.%20Tried%20keeping%20Graph%20explorer%20logged%20in%20and%20without%20logged%20in%20but%20i%20was%20able%20to%20get%20all%20the%20member%20in%20all%20scenario.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20there%20any%20particular%20sequence%20that%20you%20are%20following%3F%20if%20Yes%2C%20let%20me%20know%20the%20steps%20-%20i%20will%20try%20it%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1098332%22%20slang%3D%22en-US%22%3ERe%3A%20Inconsistent%20behaviors%20when%20retrieving%20channel%20members%20with%20graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1098332%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F322587%22%20target%3D%22_blank%22%3E%40Abhijit_MSFT%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20reply.%3C%2FP%3E%3CP%3EUnfortunately(%3F)%20I%20tested%20on%202%20of%20my%20previously%20problematic%20channels%2C%20none%20of%20them%20repeated%20that%20behavior%2C%20all%20of%20the%20members%20were%20successfully%20returned.%3C%2FP%3E%3CP%3EIt's%20kind%20of%20weird%20because%20I'm%20pretty%20sure%20the%20results%20were%20pretty%20different%20last%20night.%3C%2FP%3E%3CP%3EBut%20anyway%2C%20thanks%20for%20your%20help%2C%20and%20I'll%20post%20again%20if%20I'm%20getting%20another%20incomplete%20result%20in%20the%20future.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

 

I was trying to get members in a private channel when I noticed that one of three results may appear when I call (http GET) the api:

https://graph.microsoft.com/beta/teams/{id}/channels/{id}/members

1. An error, possibly being "Unauthorized" or "Bad Gateway"

{
  "error": {
    "code": "Unauthorized",
    "message": "Failed to execute Aad backend request GetTenantSubscribedSkusRequest. Request Url: https://graph.windows.net/8146c981-eb5d-4f42-a507-6ba4554be38a/subscribedSkus?api-version=1.6, Request Method: GET, Response Status Code: Unauthorized, Response Headers: ocp-aad-diagnostics-server-name: WqKhWXvl1okXb47qljo0lPbR3WueJ7PneT8ez1L9elM=\r\nrequest-id: 93b4d095-07e5-4297-8218-5f72278fc5f1\r\nclient-request-id: 30a0f9a7-db67-431e-bb99-b624516b9f8a\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\nDate: Tue, 10 Dec 2019 03:10:07 GMT\r\n, Reason Phrase: Unauthorized",
    "innerError": {
      "request-id": "ef0e0908-c47a-4a4d-9d76-363630a390c1",
      "date": "2019-12-10T03:10:08"
    }
  }
}

2. Returns with a incomplete member list, some of the members are not included.

3. Returns with a full member list.

 

I also noticed that whenever I login the graph api explorer with my test account, the subsequent api calls in my program will no longer error out although being no change in code or request context (same token, same channel), Until some time later (probably a day or more), this may start to show up again.

My test code (c#) was rather simple, basically a http client GET request with a pre-requested string token and an endpoint url, and my test azure app was using "application" permission, instead of "delegate".

 

So my question is, what could be causing the api call to behave like in case 1 or 2, instead of 3?

 

Thanks.

2 Replies

@ck1521, I was unable to replicate this scenario. Tried keeping Graph explorer logged in and without logged in but i was able to get all the member in all scenario. 

Is there any particular sequence that you are following? if Yes, let me know the steps - i will try it again.

@Abhijit_MSFT Thanks for your reply.

Unfortunately(?) I tested on 2 of my previously problematic channels, none of them repeated that behavior, all of the members were successfully returned.

It's kind of weird because I'm pretty sure the results were pretty different last night.

But anyway, thanks for your help, and I'll post again if I'm getting another incomplete result in the future.

 

Thanks,