User Tools

Site Tools


api:customer:address-lookup

API : Customer Address Lookup

Introduction

This request is used to search for and retrieve danish addresses.

The primary use is for address entry fields suggestions and for address validations.

Request

URL https://api.telecomx.dk/customer/address/lookup
Method GET
Access level VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN
Query limit [optional] Number of result to return at maximum. Default 10, min 1, max 50.
query The address or part of it, to lookup. Lookups are case-insensitive.
flex Setting this to true ensures that if no matching floor/door is found, but the address and house number can be found, the addresses are still returned. If only one address is returned, then queried floor/door is also included in the reply for convenience.

Query examples

https://api.telecomx.dk/customer/address/lookup?query=frug
https://api.telecomx.dk/customer/address/lookup?query=Frugtmarkedet+17
https://api.telecomx.dk/customer/address/lookup?query=Frugtmarkedet+17,+1.,+2500+Valby&flex=true

Response

The response is an array of addresses. Each address has the following properties.

JSON object
_id Id Unique id
road String Road name
number String House number
floor String Floor, e.g. 'kl', 'st', '1', 2', '3', if relevant.
door String Door, e.g. 'tv', 'mf', 'th', if relevant.
zip Integer Zip code
city String City name
code Integer Road code
muni Integer Municipality code
geo Array Position of the address, latitude and longitude

Note that properties holding no value may be omitted.

When querying, if the query only holds a roadname or partial roadname, then only roadnames will be suggested. If the query holds a roadname and number, full addresses will be returned.

Example - normal

[
  {
    _id: '55a4d4e46467999831828401',
    road: 'Adelgade',
    number: '47',
    floor: 'st',
    door: 'tv',
    zip: 1304,
    city: 'Copenhagen',
    code: 5762,
    muni: 101,
    geo : [ 55.6852028908718, 12.5843327016785 ]
  },
  {
    ...
  }
]

Errors

Error code Message Description
403 access_denied Insufficient access level
422 query Query missing
api/customer/address-lookup.txt · Last modified: 2018/09/28 11:43 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki