Title: `channels().post()` returns `null` when creating a shared channel (`membershipType: shared`) · Issue #2555 · microsoftgraph/msgraph-sdk-java · GitHub
Open Graph Title: `channels().post()` returns `null` when creating a shared channel (`membershipType: shared`) · Issue #2555 · microsoftgraph/msgraph-sdk-java
X Title: `channels().post()` returns `null` when creating a shared channel (`membershipType: shared`) · Issue #2555 · microsoftgraph/msgraph-sdk-java
Description: Describe the bug When creating a channel with membershipType set to ChannelMembershipType.Shared, the graphClient.teams().byTeamId(teamId).channels().post(channel) method returns null instead of a Channel object. This works correctly for...
Open Graph Description: Describe the bug When creating a channel with membershipType set to ChannelMembershipType.Shared, the graphClient.teams().byTeamId(teamId).channels().post(channel) method returns null instead of a ...
X Description: Describe the bug When creating a channel with membershipType set to ChannelMembershipType.Shared, the graphClient.teams().byTeamId(teamId).channels().post(channel) method returns null instead of a ...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/2555
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`channels().post()` returns `null` when creating a shared channel (`membershipType: shared`)","articleBody":"### Describe the bug\n\nWhen creating a channel with membershipType set to ChannelMembershipType.Shared, the graphClient.teams().byTeamId(teamId).channels().post(channel) method returns null instead of a Channel object.\nThis works correctly for standard and private channel types, which return the expected Channel object.\n\n## Root cause analysis\n\nAccording to the [Microsoft Graph API documentation (Example 5 — Create a shared channel)](https://learn.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=http#example-5-create-a-shared-channel-on-behalf-of-a-user), creating a shared channel returns an HTTP 202 Accepted with a Location header pointing to a teamsAsyncOperation, whereas standard/private channels return a 201 Created with the Channel object in the response body.\n\nThe SDK's .post() method appears to only handle the 201 Created case, deserializing the response body into a Channel object. When it receives a 202 Accepted (with no Channel in the body), it returns null without providing access to the response headers or the async operation.\n\nThis is the same issue reported in the .NET SDK: [microsoftgraph/msgraph-sdk-dotnet#1728](https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1728)\n\n### Expected behavior\n\nOne of the following:\n\n- Preferred: The SDK should detect the 202 Accepted response, follow the Location header, poll the teamsAsyncOperation until completion, and return the resulting Channel object — providing a consistent developer experience across all channel types.\n\n- Alternative: The SDK should return a wrapper type (e.g., ChannelPostResponse) that can represent either a Channel (for 201) or a TeamsAsyncOperation (for 202), along with the Location/Content-Location headers.\n\n- Minimum: The documentation should clearly state that .post() returns null for shared channels, and provide a documented pattern to retrieve the channel using NativeResponseHandler (or equivalent in Java).\n\n### How to reproduce\n\n```\nChannelMembershipType type = ChannelMembershipType.Shared;\n\nChannel channel = new Channel();\nchannel.setOdataType(\"#Microsoft.Graph.channel\");\nchannel.setMembershipType(type);\nchannel.setDisplayName(\"My Shared Channel\");\nchannel.setDescription(\"Test shared channel creation\");\n\nLinkedList\u003cConversationMember> members = new LinkedList\u003c>();\nAadUserConversationMember conversationMember = new AadUserConversationMember();\nconversationMember.setRoles(List.of(\"owner\"));\nHashMap\u003cString, Object> additionalData = new HashMap\u003c>();\nadditionalData.put(\"user@odata.bind\",\n \"https://graph.microsoft.com/v1.0/users('\" + ownerId + \"')\");\nconversationMember.setAdditionalData(additionalData);\nmembers.add(conversationMember);\nchannel.setMembers(members);\n\n// This returns null for shared channels, but works for standard/private\nChannel result = graphClient.teams().byTeamId(teamId).channels().post(channel);\n\nSystem.out.println(result); // null\n```\n\n### SDK Version\n\n6.62.0\n\n### Latest version known to work for scenario above?\n\n6.62.0\n\n### Known Workarounds\n\nNone\n\n### Debug output\n\n\u003cdetails>\u003csummary>Click to expand log\u003c/summary>\n```\n\n\u003cLog output here>\n\n```\n\u003c/details>\n\n\n### Configuration\n\n_No response_\n\n### Other information\n\n_No response_","author":{"url":"https://github.com/mathias-vandaele","@type":"Person","name":"mathias-vandaele"},"datePublished":"2026-03-12T09:55:23Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/2555"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:74289ada-13ca-80bd-3801-4a5c14ee86f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C72A:2FF92C:A055D:DE466:6AF6BAB2 |
| html-safe-nonce | c7171c48a78c6976fdf7f16c1330931d021ac3f2326ba0ee7831e8c1c5fa10d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzJBOjJGRjkyQzpBMDU1RDpERTQ2Njo2QUY2QkFCMiIsInZpc2l0b3JfaWQiOiI4MDI3MTU3ODEzNDU0NjE3MjY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 41be06aa17185c0fe746e18987904826a016d8e590363f539d2e1bb0b4a912d0 |
| hovercard-subject-tag | issue:4063477362 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/2555/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e2d917eee5632e9561fbe1daf68fc6a820b5d466a147254ee4f5bbe008ccd8a/microsoftgraph/msgraph-sdk-java/issues/2555 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e2d917eee5632e9561fbe1daf68fc6a820b5d466a147254ee4f5bbe008ccd8a/microsoftgraph/msgraph-sdk-java/issues/2555 |
| og:image:alt | Describe the bug When creating a channel with membershipType set to ChannelMembershipType.Shared, the graphClient.teams().byTeamId(teamId).channels().post(channel) method returns null instead of a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mathias-vandaele |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8dfae1499400ee498ab0f86538d1c034e6c1b4f51c63ecade775c3b0894e3379 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 103300409 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 103300409 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ee168845eb2be91203b179104ac9977fe4ea69a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width