aerobium / novaposhtaaddressform

Almost offline (stored in localstorage) widget for search address via Nova Poshta API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cities and warehouses search for Nova Poshta API

Backend-free and almost offline widget for search cities and warehouses via Nova Poshta API. First of all this solution is designed for the CRM.

Advantages:

  • backend-free (no requests to your backend),
  • low traffic: only one request to the Nova Poshta APU per day.

How does it work?

Once a day catalog will be updated and stored into your browser localstorage.

Usage

  • Add reference to Jquery and Jquery-ui (js and css) to your html page.
  • Add reference to novaPoshtaApi.js
  • Add some inputs to your html page (see example)
  • Put this code below
    npApi.init({
        citiesApiUrl    :   'http://api.novaposhta.ua/v2.0/json/Address/getCities',
        warehousesApiUrl:   'http://api.novaposhta.ua/v2.0/json/AddressGeneral/getWarehouses',
        apiKey          :   'YOUR_NOVA_POSHTA_API_PRIVATE_KEY',
        language        :   'UA', // can be 'UA' or 'RU'
        cityInput       :   $('input[name="city"]'),  // input with city,
        warehouseInput  :   $('input[name="warehouse"]'), // input with warehouse,
        cityRef         :   $('input[name="cityRef"]'), // input with city reference,
        warehouseRef    :   $('input[name="warehouseRef"]') // input with warehouse reference,
    });

Note: all options are mandatory in this version.

About

Almost offline (stored in localstorage) widget for search address via Nova Poshta API


Languages

Language:JavaScript 84.4%Language:HTML 15.6%