Hi @Yuvraj Patil ,
You can refer to the following rest api to create webpart page
function createWikiPage(webUrl,listTitle,fileName,success, failure)
{
getListUrl(webUrl,listTitle,
function(listUrl){
var fileUrl = listUrl + '/' + fileName
var url = webUrl + "/_api/web/GetFolderByServerRelativeUrl('" + listUrl + "')/Files" +
"/AddTemplateFile(urlOfFile='" + fileUrl + "',templateFileType=1)";
$.ajax({
url: url,
method: "POST",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest" : $("#__REQUESTDIGEST").val()
},
success: function (data) {
success(data.d);
},
error: function (data) {
failure(data);
}
});
},
failure
);
}
function getListUrl(webUrl,listTitle,success, failure)
{
var url = webUrl + "/_api/web/lists/GetByTitle('" + listTitle + "')/RootFolder";
$.ajax({
url: url,
method: "GET",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
success: function (data) {
success(data.d.ServerRelativeUrl);
},
error: function (data) {
failure(data);
}
});
}
//Usage
createWikiPage(_spPageContextInfo.webAbsoluteUrl,'Pages','WikiTestPage.aspx',
function(page){
},
function(error){
}
);
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.