0
votes

I get a 502 Bad Gateway when I try to archive a Microsoft Team :

Server error: `POST https://graph.microsoft.com/v1.0/teams/b6557192-0afd-4839-b1a7-fc1b0b452bdc/archive` resulted in a `502 Bad Gateway` response:{
  "error": {
    "code": "BadGateway",
    "message": "Failed to execute backend request.",
    "innerError": {
      "request-id": "d835ede5-b70a-4d5b-952f-e5152609d0d5",
      "date": "2020-04-27T15:20:06"
    }
  }
}

I send the follwing data as the POST body :

{
    "shouldSetSpoSiteReadOnlyForMembers": true
}

I use delegated permissions and I am owner of this Team.

Anyone ever had this issue?

1

1 Answers

1
votes

I realized that when you create a Team and you don't click on the Files tab in Microsoft Teams, if you call this endpoint with the "shouldSetSpoSiteReadOnlyForMembers": true parameter, you will get this error. If you click the Files tab once, and then call the archive endpoint, you will get a HTTP/1.1 202 Accepted response.

Hope this will help someone, took me some time to figure this out, this API always returns generic error messages which doesn't help the developer.