Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Teams response returning null #2762

Open
ARinger22 opened this issue Nov 28, 2024 · 0 comments
Open

Create Teams response returning null #2762

ARinger22 opened this issue Nov 28, 2024 · 0 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned

Comments

@ARinger22
Copy link

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
@ARinger22 ARinger22 added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned
Projects
None yet
Development

No branches or pull requests

1 participant