So recently I was trying to create a workflow to automatically provision a new web when all criteria was met. For some reason whenever the WF got to the provisioning step it failed with a Bad Request, plus it choked trying to display the responseContent from the call. All the settings looked correct (or so I thought). Taking a look at the ULS logs I was getting the following:
Microsoft.Data.OData.ODataException: The property ‘_metadata’ does not exist on type ‘SP.WebInfoCreationInformation’. Make sure to only use property names that are defined by the type.
So I banged my head a while on this until I finally noticed something. The metadata value in the request body is supposed to be a double underscore. ‘_’ and ‘__’ look very similar at the start of a variable. So if you are ever working on REST calls and come across something like this, take a look at that silly double underscore.
BTW, a great site for setting up workflow site provisioning can be found here.
Hope this helps someone with the same issue I had.
Comments