Open mladencucak opened 1 year ago
Hi @hongooi73
Would shared channels ever be an option for the create_channel
method?
I can see in the docs that there is membership
option to switch between standard or private but no info on shared ones. Thanks!
The teams-shared-channels branch now lets you set membership="shared"
to create a shared channel, let me know if it works.
Many thanks for working on that @hongooi73
Tested with
# needs specific branch!
# remotes::install_github("Azure/Microsoft365R@teams-shared-channels")
library(Microsoft365R)
team <- Microsoft365R::get_team(team_name = "Your team name here")
team$list_channels()
team$create_channel("test_shared", membership = "shared")
Channel has been created and is correctly set to shared type. However I also get an error:
Error in self$properties$displayName :
$ operator is invalid for atomic vectors
I've pushed a fix. Can you try it now?
In general, debugging business-related features is hard for me since I don't have a work/school MS365 account. I'd be grateful for any help in this regard.
Thank you for the fix - all stayed the same so the channel gets created correctly and the same error message appears
Trying to narrow it down here; does z <- team$create_channel("xyz", membership="shared")
work? Ie, creating the channel but NOT printing it to the screen.
Yes! That creates channel correctly without error 💪
Great! Can you tell me what z$properties
is?
Sure thing - this is what i get:
raw(0)
attr(,"status")
[1] 202
Ok, that means it was created properly, but the create op isn't returning the properties for the channel, like it should.
Just to confirm, you did install the latest commit from the team-shared-channel branch, yes? As of ~10-11 hours ago?
Ok, it's more complicated than I thought....
If successful, this method returns a 201 Created response code and a channel object in the response body for a channel with a membershipType value of standard or private. For a channel with a membershipType value of shared, this method returns a 202 Accepted response code and a link to the teamsAsyncOperation.
So basically, the code succeeds in creating the channel, it just isn't waiting like it should to confirm the result.
I've pushed a small change that will alert you when you're creating a shared channel. To retrieve it, wait a while and then use get_channel
. This is simpler than waiting for the async operation to complete (which would in any case negate the point of it being asynchronous).
Thanks for sorting this out, I already gave up on this :) !
Hi @hongooi73 Do you have any (even approximate) plan or timeline on when these changes could make it to main?
How to pass ah argument to:
team$create_channel(teams_channel )
to make it a shared folder?