-
Notifications
You must be signed in to change notification settings - Fork 328
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
Adds m365 spo tenant homesite add
. Closes #6488
#6533
base: main
Are you sure you want to change the base?
Conversation
Thank you @reshmee011, we'll have a look at it soon! |
try { | ||
const spoAdminUrl: string = await spo.getSpoAdminUrl(logger, this.verbose); | ||
const requestOptions: CliRequestOptions = { | ||
url: `${spoAdminUrl}/_api/SPO.Tenant/AddHomeSite`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @reshmee011, I've noticed in this command, we can only provide the URL of the home site, and nothing else. What I'm missing here, are the other properties like isInDraftMode
, vivaConnectionsDefaultStart
etc that cannot be set with this API request (or am I wrong here?) Currently, if we want to set these options, we'll have to execute a separate command, which is annoying of course. Do you know whether it's possible to provide the extra options?
I found following request, which is capable of doing so:
POST https://contoso-admin.sharepoint.com/_api/SPHSite/AddHomeSite
{
"siteUrl": "https://contoso.sharepoint.com/sites/homesite",
"audiences": ["<audiences>"],
"vivaConnectionsDefaultStart": false,
"isInDraftMode": false
}
Maybe we should roll with this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I will check if those additional parameters: isInDraftMode, vivaConnectionsDefaultStart work with the endpoint AddHomeSite. Have you tried them out?
Definitely those can be passed to the endpoint /_api/SPO.Tenant/UpdateTargetedSite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milanholemans : I get the following error with the AddHomeSite endpoint.
-vivaConnectionsDefaultStart
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter vivaConnectionsDefaultStart does not exist in
| method AddHomeSite."}}}
-isInDraftMode
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter isInDraftMode does not exist in method
| AddHomeSite."}}}
-siteUrl
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter siteUrl does not exist in method
| AddHomeSite."}}}
It seems to accept only the parameter homeSiteUrl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've tried some things as well, and didn't get it to work, unfortunately. It did work for the _api/SPHSite/AddHomeSite
API request, I have no idea if there's any difference, but it seems to be working for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milanholemans : _api/SPHSite/AddHomeSite works with these 3 parameters: audiences, vivaConnectionsDefaultStart and isInDraftMode. I will amend the code to use _api/SPHSite/AddHomeSite and add these three parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milanholemans : I will add order as well, out of curiosity where did you find information on this endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great tool from Sergei 😊
https://s-kainet.github.io/sp-rest-explorer/#/_api/SPHSite/AddHomeSite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milanholemans : thanks for sharing.
Closes #6488
New Command = Five Files