//native
/**
* List Teams
* List the teams the connected user is a member of. Requires Team.ReadBasic.All (a connection default).
*/
export async function main(auth: RT.MsTeams) {
const url = new URL(`https://graph.microsoft.com/v1.0/me/joinedTeams`)
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 2 hours ago