2017 © Pedro PelĂĄez
 

library omniva

Library to interface with Omniva web API-s

image

bigbank/omniva

Library to interface with Omniva web API-s

  • Monday, May 29, 2017
  • by anroots
  • Repository
  • 4 Watchers
  • 2 Stars
  • 2,218 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

PHP Library for Omniva API-s

Latest Stable Version on Packagist Software License Build Status Total Downloads, (*1)

A PHP library for interfacing with Omniva (former Estonian Postal Service) web API-s without dealing with SOAP (too much)., (*2)

Install

Via Composer, (*3)

``` bash $ composer require bigbank/omniva, (*4)


The library requires PHP `>=5.6`, `curl`, `soap` and `openssl` extensions. ## Usage ``` php // Instantiate the main class $omniva = new Omniva; // Ask for a service (see: Services) $addressSearchService = $omniva->getService(AddressSearchInterface::class) ->setApiKey(getenv('OMNIVA_PASSWORD')); // Get a list of all matching addresses for a partial input $addresses = $addressSearchService->findAddresses('Tartu mnt 18'); print_r($addresses);

Example implementation in examples/search-address.php can be run with, (*5)

$ OMNIVA_PASSWORD="<secret-string>" php examples/search-address.php

To use a HTTP proxy, set HTTP_PROXY environment variable., (*6)

Services

The library provides access to the following services:, (*7)

Get a list of physical addresses based on a partial input. Useful for applications like address auto-complete., (*8)

Usage

$addressSearchService = $omniva->getService(AddressSearchInterface::class)
    ->setApiKey(getenv('OMNIVA_PASSWORD'))
    ->findAddresses('Tartu mnt 18');

You can change the URL of the Omniva API endpoint by manually instantiating AddressSearch:, (*9)

$addressSearchService = new AddressSearch(
    new SingleAddress2_5_1PortTypeService($soapOptions, $wsdlUrl),
    new SingleAddress2_5_1Request
);

Sample Output

Array
(
    [0] => Array
        (
            [address] => Eesti Vabariik, Tartu maakond, Elva linn, Tartu maantee 18
            [addressNumber] => 18
            [county] => Tartu maakond
            [countyId] => 0078
            [designation] => 
            [flatNumber] => 
            [latitude] => 641443.84
            [level] => A7
            [longitude] => 6457217.29
            [mailboxType] => 
            [mainAddress] => 
            [municipality] => Elva linn
            [municipalityId] => 0170
            [municipalityType] => linn
            [nationalAddressId] => 7817000000000002H000019HC00000000
            [omnivaAddressId] => 3702034
            [postalIndex] => 61505
            [postOfficeBoxNumber] => 
            [settlement] => 
            [settlementId] => 0000
            [settlementType] => 
            [status] => Kontrollitud, kehtiv
            [territorialAddress] => 
            [territorialAddressType] => 
            [trafficSurface] => Tartu maantee
            [trafficSurfaceType] => tee
        )
)

Change log

Please see CHANGELOG for more information what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Development

Please see CONTRIBUTING for details., (*12)

Definitions

Definitions for terms used by Omniva API-s (in Estonian):, (*13)

  • EHAK - Eesti haldus- ja asustusjaotuse klassifikaator
  • ADS - Aadressiandmete sĂŒsteem
  • PĂ”hiaadress - See on vajalik juhul kui objektil on kĂŒll mitu aadressi kuid aktiivselt kasutatakse ĂŒhte nendest ja teine on varuks. NĂ€iteks kui on tegu tĂ€nava nurgal oleva majaga, millel on kaks aadressi. Hoone peasissekĂ€ik on ĂŒhelt tĂ€navalt ja see aadress oleks sel juhul pĂ”hiaadress.

These materials (in Estonian) help to understand the address domain., (*14)

Security

If you discover any security related issues, please email info@bigbank.ee instead of using the issue tracker., (*15)

Credits

License

The Apache 2.0 License (Apache-2.0). Please see License File for more information., (*16)

The Versions

29/05 2017

dev-master

9999999-dev https://github.com/bigbank-as/omniva

Library to interface with Omniva web API-s

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

bigbank omniva eesti post

29/05 2017

0.2.0

0.2.0.0 https://github.com/bigbank-as/omniva

Library to interface with Omniva web API-s

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

bigbank omniva eesti post

29/05 2017

dev-develop

dev-develop https://github.com/bigbank-as/omniva

Library to interface with Omniva web API-s

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

bigbank omniva eesti post

27/01 2016

0.1.0

0.1.0.0 https://github.com/bigbank-as/omniva

Library to interface with Omniva web API-s

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

bigbank omniva eesti post