我正在尝试使用rest API删除Office 365 SharePoint网站,但我不知道该怎么做。有没有办法使用rest APi删除Office 365 SharePoint网站。
注意:我正在使用 Graph 资源管理器在 SharePoint 上创建网站,现在我想完全删除它。
试试这个:
var restAPIURL = "siteurl/_api/web"
$.ajax
({
url: restAPIURL,
type: "POST",
async: false,
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $('#__REQUESTDIGEST').val(),
"X-HTTP-Method": "DELETE"
},
success: function(data){
console.log('site deleted');
},
error: function(data){
console.log('Error deleting site');
}
});
参考:
https://social.technet.microsoft.com/wiki/contents/articles/37462.sharepoint-online-office-365-delete-sharepoint-site-using-rest-api.aspx
https://www.c-sharpcorner.com/article/create-retrieve-update-or-delete-sites-on-sharepoint-using-rest-api/