Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Error when using HTTP request for site creation

(0) ShareShare
ReportReport
Posted on by 4

Hi,

I get some error when trying to create a site using HTTP request. It's pretty straight forward, so not sure what i'm doing wrong.

sdfsdef_0-1687178009672.png

 

I'm basicly following this: https://learn.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest, but I get this error:

 

"Cannot convert a primitive value to the expected type 'Edm.Guid'. See the inner exception for more details.
clientRequestId: 3544ed78-e876-4f6f-b983-de761d962653
serviceRequestId: 8259bea0-00af-6000-b8e0-e80699d5be82"

 

Any help would be appreciated.

  • Expiscornovus Profile Picture
    31,648 Most Valuable Professional on at
    Re: Error when using HTTP request for site creation

    Hi @sdfsdef,

     

    Yeah, in that case it probably was that SensitivityLabel value.

     

    You used:

    "SensitivityLabel":"<Your Sensitivity label ID>",

     

    In that case it will try and use a Sensitivity label with the GUID <Your Sensitivity label ID>. But that is not an actual GUID, but a string value. That's why you probably are getting the Cannot convert a primitive value to the expected type 'Edm.Guid' error.

     

    If you want to leave that empty you should use the below:

    "SensitivityLabel":"",

     

    Or remove the whole property, like I did in my example.

     

  • sdfsdef Profile Picture
    4 on at
    Re: Error when using HTTP request for site creation

    Thanks for the reply!

    The "verbose headers" did not help.

     

    However, your updated payload fixed the issue! 😀

     

    Do you mind explaining the issue? The issue was the SensitivityLabel?

     

    Thanks alot!

  • Verified answer
    Expiscornovus Profile Picture
    31,648 Most Valuable Professional on at
    Re: Error when using HTTP request for site creation

    Hi @sdfsdef,

     

    Can you try the same POST request with verbose headers?

     

    {
     "Accept": "application/json;odata=verbose",
     "Content-Type": "application/json;odata=verbose"
    }

     

    Also try the payload below. Obviously update the url to your tenant name.

     

     

    {
    "request":{
    "Title":"@{triggerOutputs()?['body/Title']}",
    "Lcid":1033,
    "Description":"@{triggerOutputs()?['body/Description']}",
    "Classification":"",
    "ShareByEmailEnabled":false,
    "SiteDesignId":"6142d2a0-63a5-4ba0-aede-d9fefca2c767",
    "Url":"https://contoso.sharepoint.com/sites/@{triggerOutputs()?['body/Title']}",
    "WebTemplate":"SITEPAGEPUBLISHING#0",
    "Owner":"@{triggerOutputs()?['body/Author/Email']}",
    "WebTemplateExtensionId":"00000000-0000-0000-0000-000000000000"
    }
    }

     

     

    verboseheaders.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,708 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,030 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow