Developer Q&A

Ask a Question
Back to All

Cannot create a Space (location)

(edited)

I am following the guide indicated here: https://developer.corrigo.com/docs/work-order-c

I'm having issues creating a space. In particular, I am mimicing this code sample:

var command = new SpaceCreateCommand
{
/ newly created Customer Id from prior step to link Space to Customer /
CustomerId = customer.Id,
NewUnitSpecifier = new NewUnitSpecifier
{
UnitName = unitName,
/ asset template name /
UnitFloorPlan = unitFloorPlan,
StreetAddress = new Address2 { ActorTypeId = ActorType.CommLeaseSpace, }
}
};
var response = corrigoService.Execute(command);

But when I try to create a space I am getting this error:

'ErrorInfo': {
    'Number': 0,
    'Description': "Template name is required to create new 'Building'",
    'Type': 'Corrigo.Core.CorrigoBORuleViolationException'
},
'NewSpace': None

Is there a particular default template name I can use? Do I need to create a template before creating a space? Below is the XML I'm passing:

<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope">
<soap-env:Body>
<ns0:Execute xmlns:ns0="http://corrigo.com/integration/">
<ns0:commandRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:SpaceCreateCommand">
<ns0:CustomerId>661</ns0:CustomerId>
<ns0:NewUnitSpecifier>
<ns0:BuildingName>building_1</ns0:BuildingName>
<ns0:FloorName>floorname</ns0:FloorName>
<ns0:FloorFloorPlan>floorfloorplan</ns0:FloorFloorPlan>
<ns0:UnitName>unit_1</ns0:UnitName>
<ns0:UnitFloorPlan>unitfloorplan</ns0:UnitFloorPlan>
<ns0:StreetAddress>
<ns0:Street>111</ns0:Street>
<ns0:Street2>sbm</ns0:Street2>
<ns0:City>burlingame</ns0:City>
<ns0:State>CA</ns0:State>
<ns0:Zip>11344</ns0:Zip>
<ns0:Country>US</ns0:Country>
</ns0:StreetAddress>
</ns0:NewUnitSpecifier>
</ns0:commandRequest>
</ns0:Execute>
</soap-env:Body>
</soap-env:Envelope>

Any advice on how to get the space created? If it matter, unltimately, I would like to create a WorkOrder via the API.