Public Repository

Last pushed: 8 months ago
Short Description
Short description is empty for this repo.
Full Description

exakta-addresspicker

Installation

git clone https://github.com/c4webbutveckling/exakta-addresspicker.git ./
cp .env.example .env
# Set DB_DATABASE, DB_USERNAME, DB_PASSWORD in .env
# Set DIREKTMEDIA_USERNAME, DIREKTMEDIA_PASSWORD in .env
composer install
php artisan key:generate
php artisan migrate

API

Endpoint

http://exakta-addresspicker.se.cust.c4hosting.se/api

Method

GET

Parameters

order_number: required, string, max length: 255
street: required, string, max length: 255
zip_code: max length: 255
city: required, string, max length: 255
headcount: required, integer, max value: 4294967295
age_min: required, integer
age_max: required, integer, max value: 255
telephone: equals to 1
building_types: array, one or many of the following values : 30, 1504, 512

Examples

Incorrect parameters

Request
http://exakta-addresspicker.se.cust.c4hosting.se/api?order_number=123ABC&headcount=abc&street=Västerslöv 953&age_min=21&age_max=99&zip_code=28990&telephone=1&city=Knislinge&building_types[]=30&building_types[]=1504&building_types[]=512
Response
{
    "request": {
        // parameter list
    },
    "results": [], // empty array
    "errors": {
        // error messages indexed by field name. For example :
        "headcount": [
            "Antal måste vara ett heltal."
        ]
    }
}

Direktmedia error:

Request
http://exakta-addresspicker.se.cust.c4hosting.se/api?order_number=123ABC&headcount=200&street=Västerslöv 953&age_min=21&age_max=99&zip_code=28990&telephone=1&city=Lille&building_types[]=30&building_types[]=1504&building_types[]=512
Response
{
    "request": {
        // parameter list
    },
    "results": [], // empty array
    "errors": [
        // direktmedia error messages. For example :
        "Kan ej finna koordinater för angiven adress"
    ]
}

Valid:

Request
http://exakta-addresspicker.se.cust.c4hosting.se/api?order_number=123ABC&headcount=200&street=Västerslöv 953&age_min=21&age_max=99&zip_code=28990&telephone=1&city=Knislinge&building_types[]=30&building_types[]=1504&building_types[]=512
Response
{
    "request": {
        // parameter list
    },
    "results": [
        {
          "Fornamn": "John",
          "Efternamn": "Doe",
          "FbfGatuadress": "DemoAdress",
          "FbfPostnummer": "01234",
          "FbfPostort": "DemoStad",
          "FbfCoadress": [],
          "ReferensId": "00123467",
          "Adresskalla": "DemoAdresskälla",
          "OrderIdentifikation": "OrderIdentifikation",
          "SekundarOrderIdentifikation": "SekundarOrderIdentifikation",
          "TertiarOrderIdentifikation": "TertiaryOrderIdentification",
          "KvartarOrderIdentifikation": "QuaternaryOrderIdentification",
          "FbfLatitude": "59,375833",
          "FbfLongitude": "18,012778"
        },
        ...
    ],
    "errors": [] // empty array
}
Docker Pull Command
Owner
simondubois

Comments (0)