OS1 Services

Location Service

6min
introduction the location service is responsible for the management of locations and addresses this service provides storage of locations and country/city specific data (such as country name, city name, zip code, etc ) which can be used to validate whether info provided in location is valid or not note that, location or static data is tenant specific location a location is a particular place or position to represent it as an address is not enough it can be represented by a geopoint or a combination of address and geopoint thus, a location could be an address and/or a geocode create a location to add a location, call the create location endpoint to update a location, call the update location endpoint the following table shows the parameters that are passed to the create location endpoint the update location endpoint takes a subset of these parameters as necessary for the update member description data type buildingnumber house number of the address it must be 1 to 16 characters in length string addressline1 the street information of the address it must be 1 to 128 characters in length string addressline2 an optional additional field for the street address it must be 1 to 128 characters in length string addressline3 an optional additional field for the street address it must be 1 to 128 characters in length string city the city, town, or village of the address the value must match 'a z' or 'a z', inclusive (range) string state state of the address the value must match 'a z' or 'a z', inclusive (range) it must be 2 to 64 characters long string code the two letter code for the country the value must match 'a z', inclusive (range) it must be 2 or 3 characters long string name the name of the country of the address the value must match 'a z' or 'a z', inclusive (range) it must be 2 to 64 characters long string lat the range of latitude is 90 to 90 and can be up to 6 decimal places example 30 3752° n string long the range of longitude is 180 to 180 and can be up to 6 decimal places example 76 7821° e string request bodies are specified in json format the following examples show a request body for creating a location and a request body for updating a location create location { "tags" { "timezone" "utc 5 eastern standard time (est)", }, "address" { "buildingnumber" "123", "addressline1" "main street anytown", "addressline2" "sample road", "city" "queens", "state" "new york", "country" { "code" "+1", "name" "united states" }, "zipcode" "10001" }, "geolocation" { "lat" "40 674778", "long" " 73 800629" } } update location { "tags" { "timezone" "utc 8 pacific standard time (pst)", }, "address" { "buildingnumber" "58 e", "addressline1" "4842 horizon circle", "addressline3" "marylebone, nw1 6xe, uk", "city" "tacoma", "state" "washington", "zipcode" "98402" }, "geolocation" { "lat" "47 215637", "long" " 122 491043" } } location models the location is considered as an aggregation of address and geocode with that, an apartment in a building has an address and geocode the apartment number is identified by the buildingnumber in the address thus two apartments in a building will be distinguished by different addresses location, geocode, and address is defined in location service as location address address geocode geocode locationinfo object geocode longitude (double) the range of longitude is 180 to 180 and can be up to 6 decimal places latitude (double) the range of latitude is 90 to 90 and can be up to 6 decimal places address buildingnumber (string) building number of the address addressline1 (string) the street information of the address addressline2 (string) an optional additional field for the street address addressline3 (string) another optional additional field for the street address of the billing address county (string) county of the address city (string) the city, town, or village of the address state (string) state of the address zipcode (string) postal code of the address country (country) country consists of code and name