microsoftgraph / msgraph-sdk-go

Microsoft Graph SDK for Go
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
214 stars 32 forks source link

Documentation states wrong OData bindings #717

Closed HorizonNet closed 1 month ago

HorizonNet commented 1 month ago

When following the example to create a team in Teams the following error pops up when either setting an owner or a template for the team (by specifying odataBind as in the example)

Unable to create team, got error: The navigation bind for the user was missing in request

After finding the following thread (and trying out the proposed solution) it seems like the documentation needs be updated to point to the correct binding. For me the following works when setting the template and assigning the owner

...
newTeam.SetAdditionalData(map[string]interface{}{
    "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
})

...

conversationMember.SetAdditionalData(map[string]interface{}{
    "user@odata.bind": "https://graph.microsoft.com/v1.0/users('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')",
})
...
rkodev commented 1 month ago

Hi @HorizonNet, thanks for discovering and reporting on the documentation issue. A fix for the documentation is currently underway