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
Support for creating Site Collection #23
Comments
Hi @swapnilgaonkar, are you running SharePoint Online? In SPO, we can handle this using /_api/SPSiteManager endpoint. However, if it's On-Prem it depends on the version, and not possible via client-side APIs in older SharePoint versions. |
Added samples of Site Creation: https://github.com/koltyakov/gosip-sandbox/tree/master/samples/modernSites |
Thanks for reply. I am looking for API/method which can create all type of site collection(similar to 'tenant.CreateSite' in c# CSOM). |
Classic site collections can only be created using Tenant API (CSOM, that you've mentioned), it's unlikely that something will appear in REST or Graph regarding Classic sites ever. So, if it's single time automation I'd suggest mixing Go & other friendly technologies together. If a method which is entended being in a solution and only pure Go is appropriate without other prerequisites and dependencies, when ProcessQuery helper and crafted CSOM XML package withing a custom method is a way to go. |
Thanks, |
FYI, I have to modify ProcessQuery by adding code mentioned in bold. data, err := ioutil.ReadAll(resp.Body) var arrRes []interface{} |
Interesting. Maybe it's environment-specific as ProcessQuery's implementation is used in a number of places but no issues due to BOM prefix. Added BOM prefix removal to the codebase, at least it doesn't break anything with CSOM which worked before. If you'd like, feel free to post a PR with an example for classic sites in SPO to the sandbox project, so we can reference it as a solution here for others to reuse. |
I can't find API in your library to create new Site Collection.
There is API to create sub-site under particular site but no API to create Site collection
The text was updated successfully, but these errors were encountered: