Not able create sharepoint site using sharepoint api

Not able create sharepoint site using sharepoint api
0

Upvotes

Upvote

 Nov 09 2023
2 Comments (2 New)
New

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.

 

Comments
Copper 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



Create Modern SharePoint Sites using REST | Microsoft Learn

Copper Contributor

@sajtanThank you for your help its really appriciated.I was missing owner i put the owner and its working now Thank you