Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Composing a Request

Take a look at the examples to see how the requests and responses may look. Note that the apiKey parameter must be present in each request. 

Info

Most request are depending on the response of a previous request.

Step 1 - Get

...

Street Collections

Status
colourBlue
titleGET
/{countryCode}/streetSearch/{streetName}

...

Expand
titleDetails


Request

Query Parameters
ParameterTypeExampleDescription
apiKeystringmyapikeyPlease contact us if you don't know your API key.

location

stringosloTo show street name from relevant city first. If you want to show the streets in the user's city first in the result, you will have to use a service to find the city of the user's IP address. For common street names this is useful (i.e. Kirkegata, Skoleveien or Storgata)
limitToOfficialbooleantrueIf you want to limit the results to official Norwegian addresses (will eliminate duplicates). Default is false

Response

Status
colourGreen
titleSTATUS 200
 - application/JSON

Code Block
languagejs
{
    "streets": [
        {
			"countryCode": String,
			"city": String",
            "streetName": String,           
            "streetIds": List<Integer> 	// A street has one or more id's
        }
    ],
	"totalResults": Integer
}



Step 2 - Get

...

Street Numbers for

...

Collection

Status
colourBlue
titleGET
/{countryCode}/streetNumberSearch/{streetIds}

...

Expand
titleDetails


Request

Query Parameters
ParameterTypeExampleDescription
apiKeystringmyapikeyPlease contact us if you don't know your API key.

streetNumber

whole number10Filter results by street number
limitToOfficialbooleantrueIf you want to limit the results to official Norwegian addresses (will eliminate duplicates). Default is false

Response

Status
colourGreen
titleSTATUS 200
 - application/JSON

Code Block
languagejs
{
    "streetNumbers": [
		{
            "streetNo": Integer,
            "addressId": Integer,
            "entrance": String,						// Present if a building has several entrances, where the value is the entrance name
            "houseType": String, 					// See the following examples 
            "deliveryPointId": Integer,
            "postalCode": String,
            "duplicateNumberAndEntrance": Boolean, // Some streets have several entrances on the same street number. When duplicateNumberAndAddress is true, the houseType should be used to separate them
            "latitude": Number, 
            "longitude": Number
        },
		...
	]
}

House types:

(E)nebolig     - detached house
(R)ekkehus   - row house
(B)lokk          - apartment building 
(F)orretning  - business
(H)ytte          - holiday house
(A)nnet         - other

Example address with duplicateNumberAndEntrance: Akersgata 45 (houseType B and F)


Step 3 - Get

...

Floors

Status
colourBlue
titleGET
/{countryCode}/address/{deliveryPointId}/floors

Returns the floors available at an deliveryPointId

Expand
titleDetails


Request

Query Parameters
ParameterTypeExampleDescription
apiKeystringmyapikeyPlease contact us if you don't know your API key.

Response

Status
colourGreen
titleSTATUS 200
 - application/JSON

Code Block
languagejs
{
	{
       	"floorType": String, 		// The floor type represented by a single letter
       	"floorTypeName": String,	// The full word of the floor type (in Norwegian)
       	"floorNo": Integer
    },
    ...
}

 Floor types:

(H)ovedetasje - main floor
(U)nderetasje - lower ground floor
(L)oft              - loft
(K)jeller          - basement

 See also hovedprinsipp for bolignummer i Norge


Step 4 - Get

...

Households on

...

Floor

Status
colourBlue
titleGET
/{countryCode}/address/{deliveryPointId}/floor/{floorType}-{floorNo}/households

...

Expand
titleDetails


Request

Query Parameters
ParameterTypeExampleDescription
apiKeystringmyapikeyPlease contact us if you don't know your API key.

Response

Status
colourGreen
titleSTATUS 200
 - application/JSON

Code Block
languagejs
[
    {
        "flatNo": Integer,
        "deliveryPointId": Integer,
        "flatNoAlias": String
    },
    ...
]


Extra - Coverage /

...

Distribution Support

Status
colourBlue
titleGET
/{countryCode}/address/{deliveryPointId}/distributionSupport/{customerSystem}-{productName}

...

Expand
titleDetails


Request

Path Parameters

The customerSystem and productName is defined when signing up for the service. Please contact us if you don't know your customer system.

Query Parameters
ParameterTypeExampleDescription
apiKeystringmyapikeyPlease contact us if you don't know your API key.

distrDate

string/date2018-08-01Check the available distribution on a given day. If not present, a general response is provided

extendedTransportInfo

booleantrueMake detailed distribution information available (distrInfo in the response). Default is false. Note that the distrDate must be specified in the request to make use of this feature
namestringlisaThis is an experimental feature, and is helpful when there is a mismatch between the user input and historical data

Response

Status
colourGreen
titleSTATUS 200
 - application/JSON

Code Block
languagejs
{
    "hasSupport": boolean,							// Defines if an address (deliveryPointId) has support for delivery. See remarks. 
    "coveredWeekdays": List<Boolean>,				// Shows the distribution support per weekday, starting on Monday. Does not consider holidays etc
    "distrDate": String, 							// "YYYY-MM-DD"
    "hasProductExclusion": Boolean,					// Set to true if the delivery point is excluded, all days. No delivery
    "deliveryPointId": Integer,						
    "keyDeviationWeekdays": Map<Integer, String> 	// Shows the key deviation per weekday, starting on Monday. The value indicates the issue
    "hasKeyDeviation": false,						// Tells whether there are any deviations in key access, eg. a key is broken. If true, the hasKeyDeviationWeekdays list can be used to determine which days are effected and how
    "deliveryPlace": "door"							// Where the user should pickup or put the packet. Default value "mailbox". See remarks
	"distrInfo": 									// Present if extendedTransportInfo is specified in the request
}

(warning) If distrDate is unspecified, hasSupport will be true if there is coverage on the specified deliveryPointId (at least one day of the week).

(warning) If distrDate is unspecified, deliveryPlace will be set to the default value "mailbox". The deliveryPlace is depending on the distrDate as the value may vary on different weekdays. 

(warning) If distrDate is specified, and hasSupport is false, it means that there is no support on the address on the given date. deliveryPlace will be set to the default value "mailbox". If hasSupport is false, the coveredWeekdays can be used to determine if there is coverage on other days of the week. 


Extra - Distribution

...

Dates

Status
colourBlue
titleGET
/{countryCode}/distributionDates/{customerSystem}-{productName}/{fromDate}/{toDate}

...

Code Block
languagebash
titlegetStreetCollections Request
# NOTE: Remember to concatenate the URL/QueryString - we have spread it over several lines for better readability

curl 'https://app.di.no/ws/json/addressHelper/v-2/NO/streetSearch/akersgata
	?apiKey=<your-api-key>'
-H 'referer: <your-web-address>'

...