question

AbdulSaifBabu-7422 avatar image
0 Votes"
AbdulSaifBabu-7422 asked Jerryzy commented

Create site is failing using REST API - Inconsistent behavior

REST Endpoint: http://<sp>/_api/web/webs/add

We are getting the below error randomly while creating a site.

Error:
error : {"error_message":{"response_code":500,"code":0,"message":"400 - A required parameter is not specified or has null or invalid value.{\"odata.error\":{\"code\":\"-2147024809, System.ArgumentException\",\"message\":{\"lang\":\"en-US\",\"value\":\"Value does not fall within the expected range.\"}}}}}

office-sharepoint-online
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there any update ?

0 Votes 0 ·

Hi @Jerryzy-MSFT ,

yes, it is working as expected,

Thanks

0 Votes 0 ·

Great, then you could switch to the orginal question account as "AbdulSaifBadu-7422" and accept as answer so that it could also help others in the forum who have the same question in the forum.

Thanks

0 Votes 0 ·
Jerryzy avatar image
0 Votes"
Jerryzy answered

Hi @AbdulSaifBabu-7422 ,

I'm creating the sub site using "/_api/web/webinfos/add":

 Uri: {rootsite}/_api/web/webinfos/add
 Method: POST
 Header: {content-type:'application/json;odata=verbose'}
 Body:{
    "parameters":{
       "__metadata":{
          "type":"SP.WebInfoCreationInformation"
       },
       "Url":"NewSubSite",
       "Description":"NewSubSite description",
       "Title":"NewSubSite Site",
       "Language":1033,
       "WebTemplate":"STS#0",
       "UseUniquePermissions":true
    }
 }

80482-snipaste-2021-03-23-13-13-12.png


80495-snipaste-2021-03-23-13-13-43.png

Reference:

Create Sub Site in SharePoint using REST API

Thanks
Best Regards



If an Answer is helpful, please click "Accept Answer" and upvote it.
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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PankajKumar-4692 avatar image
0 Votes"
PankajKumar-4692 answered Jerryzy commented

Hi @Jerryzy-MSFT ,

we have implemented this, as this is inconsistent , we need to test more this, will update

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please use "/_api/web/webinfos/add" instead and if there is update, please share with us..

0 Votes 0 ·