Open
Description
const createTeam = async (accessToken: string, teamName: string) => {
const userId = USER_DETAILS['email'];
const client = Client.initWithMiddleware({
authProvider: new CustomTokenCredential(accessToken),
});
const createTeamPayload = {
"[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"displayName": "Roundglass",
"description": "My Sample Team's Description",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"[email protected]": "https://graph.microsoft.com/v1.0/users/" + userId
}
]
};
try {
const response = await client.api('/teams').post(createTeamPayload);
console.log(response);
console.log("Team created:", response.headers);
console.log("Team created:", response.headers.location);
} catch (error) {
console.error("Error creating team:", error);
}
};
this is response which is coming
ReadableStream {locked: false}locked: false[[Prototype]]: ReadableStream
Team created: undefined
expected response should be
HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /teams('dbd8de4f-5d47-48da-87f1-594bed003375')/operations('3a6fdce1-c261-48bc-89de-1cfef658c0d5')
Content-Location: /teams('dbd8de4f-5d47-48da-87f1-594bed003375')
Content-Length: 0
Activity