Different response for the member ID, within the identical request of members of a team

Alexander Lichtleitner 1 Reputation point
2021-07-12T06:51:35.143+00:00

I would like to delete a member of a team. For that I need to get the membership-id of a user.
The api call for that is https://graph.microsoft.com/v1.0/teams/{{teams-id}}/members

Sometimes the response of this call gets me a diferrent membership-id for the same user.

Short version(anonymized): 'id': 'ZmZhYTc5XXXtYWVmNi0XXXX1LThkNzQtXXXXYTRhMTgzYTkyIyMwMTdhNzXXXX02NWQ4LTQ0NTgtYTXXXXX4ZDU3N2FlNmYXXXXX'
Long version(anonymized): 'id': 'MCMjMSMjMWU3OWMXXXXtMDEyMS00XXX4LTk2ZDctZWI1MTY4MDYyNWVkIyNXXXFhNzk2Mi1hZWY2LTRmXXXtOGQ3NC0yOXXXXGExODNhOTIjIzAxN2E3NGUxLTY1ZDgtNDQ1OC1hMWU4XXXXXTc3YWU2ZjczNA=='

If I try to delete a member with one of the ids, it is possible that I get an error message.

"message":"You do not have access to this resource.",

Permissions are set and the error occurs only sometimes.

Has anyone an idea?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,999 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,250 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Meghana-MSFT 3,881 Reputation points Microsoft Vendor
    2021-07-14T15:08:05.723+00:00

    @Alexander Lichtleitner ,

    We tried to repro the issue at our end, but we got same membership-id for the same user every time.

    Could you please share the request and response along with the header when you get different response for the same user? Please make sure you have removed any PII.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.