DispatchOne Solution
Facility API

Creating Property and Facility

3min
creating property to create a property, call the post /properties endpoint and specify the following parameters in the request body member description remarks propertyname name of the participant property data type string character length min 1 & max 64 propertycode any unique id associated with the participant property being created data type string character length min 1 & max 64 propertyownerid the participant id of the participant type as specified in allowedowners during the creation of the said type data type string character length min 1 & max 64 propertyownership type of ownership value self, rented, partner, client data type string area the area covered under the property location address housenumber building number in which the apartment is data type string location address addressline1 address line 1 data type string location address addressline2 (optional) optional address line 2 data type string location address addressline3 (optional) optional address line 3 data type string location address zipcode zip code of the property data type string location address city city of the property data type string location address state state of the property data type string location address country code country code data type string string in iso 3166 1 alpha 2 location address country name country name data type string geolocation latitude latitude of the property data type string geolocation longitude longitude of the property data type string the following example request body shows how to create and update a property named example property create property { "propertyname" "example property", "propertycode" "regno 784734", "propertyownerid" "rg estate", "area" 120000, "propertyownership" "self", "location" { "address" { "housenumber" "123", "addressline1" "main street", "addressline2" "anytown", "zipcode" "10001", "city" "queens", "state" "new york", "country" { "code" "us", "name" "united states" } }, "geolocation" { "lat" "45", "long" "90" } } } update property { "area" 1200, "propertyownership" "tenant", "tostate" "active\ active", "location" { "address" { "housenumber" "123", "addressline1" "main street", "addressline2" "anytown", "zipcode" "10001", "city" "queens", "state" "new york", "country" { "code" "us", "name" "united states" } }, "geolocation" { "lat" "45", "long" "90" } } } after you create a property, the response from the call includes a propertyid that will be used during the facility creation process to map it to the property when you fetch property details using the get /properties api, the response includes a locationid which is a system generated unique identifier creating facility to create a facility, call the post/facility endpoint and specify the following parameters in the request body member description remark facilityname name of the participant facility data type string character length min 1 & max 64 facilitycode any unique id associated with the participant facility being created data type string character length min 1 & max 64 facilityownerid the participant id of the participant type as specified in allowedowners during the creation of the said type data type string character length min 1 & max 64 facilitytype type of facility data type string propertyid id of the property to which this facility belongs data type string area area of the facility data type number operatingduration (optional) hours of operation of the facility data type string(hh\ mm\ ss to hh\ mm\ ss) operatingdays (optional) days of operation of the facility data type string(days of the week/dates in a month) starttime starting time of the facility data type string endtime end time of facility data type string teams (optional) the array of team ids the facility belongs to data type array the following example request body shows how to create and update a facility named example facility create a facility { "facilityname" "test hub", "facilitycode" "regno 92938343", "facilityownerid" "tenant 0e85e4d8 e9d5 4706 a33c 8ca013092e76", "facilitytype" "pudcenter", "area" 75, "operatingduration" "10 00am 11 30pm", "operatingdays" \[ "mon", "tue", "wed" ], "starttime" "10 00 am", "endtime" "10 00 am", "teams" \[ "teams 2452 2253 2223 3332", "teams 5437 2273 8972 3345" ], "propertyid" "properties 0e85e4d8 e9d5 4706 a33c 8ca013092e76", "property" { "propertyname" "bhiwandi plot 23", "propertycode" "regno 784734", "propertyownerid" "rg estate", "area" 120000, "propertyownership" "tenant", "location" { "address" { "housenumber" "123", "addressline1" "main street anytown", "addressline2" "sample road", "city" "queens", "state" "new york", "zipcode" "10001", "country" { "code" "us", "name" "united states" } }, "geolocation" { "lat" "45", "long" "90" } } } } update a facility { "propertyid" "properties 0e85e4d8 e9d5 4706 a33c 8ca013092e76", "area" 75, "operatingduration" "10 00am 11 30pm", "starttime" "10 00am", "endtime" "11 30pm", "operatingdays" \[ "mon", "tue", "wed" ], "tostate" "active\ active" } to map multiple facilities to the same property, specify the property id of the property in the propertyid parameter of the request body