sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Create SharePoint Communication site request is broken

Open romanSlivinskyi opened this issue 8 years ago • 16 comments

When I try to create communication site following the documentation on

https://docs.microsoft.com/en-gb/sharepoint/dev/apis/communication-site-creation-rest

I always get the following response:

{
    "d": {
        "Create": {
            "__metadata": {
                "type": "SP.Publishing.PublishingSiteCreationResponse"
            },
            "SiteStatus": 3,
            "SiteUrl": ""
        }
    }
}

The request was to:

{tenant}/_api/sitepages/communicationsite/create

With the body:

{
   "request":{
   	   "__metadata":{
         "type":"SP.Publishing.CommunicationSiteCreationRequest"
      },
      "Title":"Comm Site 1",
      "Description":"Description",
      "Url":"{tenant}/sites/comsite"
   }
}

romanSlivinskyi avatar Jun 29 '18 08:06 romanSlivinskyi

Site status with a return value of '3' means that site is "Creating". That should indicate that the site creation is in progress. Is the site created after a while or it's not created at all?

VesaJuvonen avatar Jul 02 '18 13:07 VesaJuvonen

Site is not created at all For https://{tenant}/sites/comsite, gives me 404 FILE NOT FOUND

romanSlivinskyi avatar Jul 02 '18 14:07 romanSlivinskyi

@VesaJuvonen Is there a solution to this problem? This api is still broken.

findyoucef avatar Feb 18 '19 20:02 findyoucef

@romanSlivinskyi Did you resolve this problem, Roman?

findyoucef avatar Feb 18 '19 20:02 findyoucef

Yes, the site was in a recycle bin. So, you have to make sure that you completely deleted a site, if you make a new one with the same url. But the response for request is not informative.

romanSlivinskyi avatar Feb 19 '19 07:02 romanSlivinskyi

@romanSlivinskyi Thanks for the response. I think i may be having a different problem. as my site is not in the bin. It's a brand new site.

findyoucef avatar Feb 19 '19 20:02 findyoucef

Can you show the request you are traying to send? By the way, there are two bins, and the second one is only visible via powershell. Did you try to create your site through powershell?

romanSlivinskyi avatar Feb 19 '19 21:02 romanSlivinskyi

@romanSlivinskyi

{ "request":{ "__metadata":{ "type":"SP.Publishing.CommunicationSiteCreationRequest" }, "AllowFileSharingForGuestUsers":"false", "SiteDesignId":"6142d2a0-63a5-4ba0-aede-d9fefca2c767", "Description":"aurora1234Site", "Title":"aurora1234Site", "Url":"https://mytenant.sharepoint.com/sites/aurora1234Site", "lcid":1033 } }

sending it to by POST: https://mytenant.sharepoint.com/_api/sitepages/communicationsite/create

https://docs.microsoft.com/en-us/sharepoint/dev/apis/communication-site-creation-rest

the status endpoint works fine with existing sites

findyoucef avatar Feb 19 '19 21:02 findyoucef

@romanSlivinskyi also Roman can you tell which powershell command you're referencing when saying there is a second recycle bin?

Thanks!

findyoucef avatar Feb 19 '19 21:02 findyoucef

I am sending the request to

https://mytenant-admin.sharepoint.com/_api/sitepages/communicationsite/create

So the host should be mytenant-admin, don't know is it a workaround or not, but it works for me. Also I use Get-SPODeletedSite to check deleted sites from recycle bin. and Get-SPOSite to fetch all of my active sites cause the old-classic ui , doesn't show them all.

romanSlivinskyi avatar Feb 20 '19 08:02 romanSlivinskyi

@romanSlivinskyi Thanks for the help, unfortunately trying to create via this endpoint is still broken for me. I looked at the http headers in the admin portal and found a few undocumented endpoints one being https://tenant.sharepoint.com/_api/SPSiteManager/Create which allows me to create a site successfully and even allows me to add an owner in the request with the following body:

{ "request": { "__metadata": { "type": "Microsoft.SharePoint.Portal.SPSiteCreationRequest" }, "WebTemplate": "SITEPAGEPUBLISHING#0", "Title": "showcasetest", "Url": "https://mytenant.sharepoint.com/sites/showcasetest", "Description": "test", "Classification": "", "SiteDesignId": "6142d2a0-63a5-4ba0-aede-d9fefca2c767", "Lcid": 1033, "ShareByEmailEnabled": false, "WebTemplateExtensionId": "00000000-0000-0000-0000-000000000000", "Owner": "i:0#.f|membership|[email protected]", "HubSiteId": "00000000-0000-0000-0000-000000000000" } }

findyoucef avatar Feb 20 '19 23:02 findyoucef

Have you tried to use mytenant-admin.sharepoint.com host? Can you show the response you receive?

romanSlivinskyi avatar Feb 21 '19 08:02 romanSlivinskyi

@romanSlivinskyi I have tried with mytenant-admin.sharepoint.com and I have the same result. It comes back with 200 and a json body with the same same result:

{ "d": { "Create": { "__metadata": { "type": "SP.Publishing.PublishingSiteCreationResponse" }, "SiteStatus": 3, "SiteUrl": "" } } }

findyoucef avatar Feb 21 '19 17:02 findyoucef

it is working fine for me. Please make sure you specify owner property. I was getting same error but I just appended owner property and it worked for me.

url: - https://camqa.sharepoint.com/_api/SPSiteManager/Create headers :-
X-RequestDigest:{{SharepointFormDigest}} Content-Type:application/json;odata=verbose Accept:application/json;odata=verbose body :- { "request": { "__metadata": { "type": "Microsoft.SharePoint.Portal.SPSiteCreationRequest" }, "Title": "TestSitesunny222", "Lcid": 1033, "Description": "", "ShareByEmailEnabled": false, "SiteDesignId": "6142d2a0-63a5-4ba0-aede-d9fefca2c767", "Url": "https://camqa.sharepoint.com/sites/TestSitesunny222", "WebTemplate": "SITEPAGEPUBLISHING#0", "WebTemplateExtensionId": "00000000-0000-0000-0000-000000000000", "Owner": "i:0#.f|membership|[email protected]", "HubSiteId": "00000000-0000-0000-0000-000000000000" } }

sgsmittal226 avatar May 22 '21 01:05 sgsmittal226

This issue is being closed as part of an issue list cleanup project. Issues with no activity in the past 6 months that aren't tracked by engineering as bugs were closed as part of this inititive. If this is still an issue, please follow the steps outlined to re-open or submit a new issue.

ghost avatar Dec 30 '21 14:12 ghost

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Jan 06 '22 18:01 ghost