Not able create sharepoint site using sharepoint api
endpoint = _api/SPSiteManager/create
payload = {
"request": {
"Title": "Rushi",
"Url":"https://xyz.sharepoint.com/sites/rushi",
"Lcid": 1033,
"ShareByEmailEnabled":false,
"Classification":"Low Business Impact",
"Description":"Test",
"WebTemplate":"SITEPAGEPUBLISHING#0",
"WebTemplateExtensionId":"00000000-0000-0000-0000-000000000000"
}
}
Response = {
"odata.metadata": "https://xyz.sharepoint.com/_api/$metadata#Microsoft.SharePoint.Portal.SPSiteCreationResponse",
"SiteId": "",
"SiteStatus": 3,
"SiteUrl": ""
}
header = Authorization and X-RequestDigest that is genrated dynamically.
Please help me to understand what is wrong with the API.
2 Comments
- rushikeshkanekarCopper Contributor
sajtanThank you for your help its really appriciated.I was missing owner i put the owner and its working now Thank you
- sajtanCopper Contributor
If your using a app to create the SharePoint site you might need to have
"Owner":"email address removed for privacy reasons",
in your payload/body
https://learn.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest#create-a-modern-site