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 #1874

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

Create Teams response returning null #1874

ARinger22 opened this issue Nov 28, 2024 · 2 comments

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
@andrueastman
Copy link
Member

Thanks for raising this @ARinger22

Any chance you could confirm if you are using the Microsoft graph library for C#? From the examples it looks to not be so.

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Feb 4, 2025
@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Feb 4, 2025
@ARinger22
Copy link
Author

ARinger22 commented Feb 5, 2025

Actually, I was working on Teams App development, so I was using the Microsoft Graph library to create a team from my app. I was doing all of this in React (JavaScript). As for JavaScript, the function mentioned in the issue was given in the documentation, so its expected output was provided. However, when I integrated this, it gave me an unexpected output.

https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=javascript

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Feb 5, 2025
@andrueastman andrueastman transferred this issue from microsoftgraph/msgraph-sdk-dotnet Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants