Описание
PHP класс для работы с почтой Intime
Документация
Інструкція по інтеграції з веб- сервісами Ін-Тайм. API 3.1
Требование
- PHP не ниже 7.0
- Composer
Composer
composer require jackmartin/api3intime
Библиотеки
Методы API
- Настройка подключения
- Получить список стран
- Получить информацию о стране по ID
- Получить список областей
- Получить информацию о областе по ID
- Получить список областей по фильтру
- Получить список районов
- Получить информацию о районе по ID
- Получить список районов по фильтру
- Получение список населенных пунктов
- Получить информацию о населенным пункте по ID
- Получить список населенных пунктов по фильтру
- Получение список складов / почтоматов
- Получить информацию о складе / почтомате по ID
- Получить список складов / почтоматов по фильтру
- Получить список описаний груза
- Получить описание груза по ID
- Получить список упаковок
- Получить упаковку по ID
- Создать заявку ТТН
- Получить список графика работы складов
- Получить график работы склада по ID
- Получить список историй ТТН
- Получить информацию ТТН
Пример
__construct()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
// $intime = new InTime3('API_KEY', true, false, 30, 30);
// $intime = new InTime3('API_KEY', true, false);
get_country_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
//$intime = new InTime3('API_KEY', false); print data stdclass format
//$intime = new InTime3('API_KEY', false, true); debug mode
print_r($intime->get_country_list());
//{"Entry_get_country_by_id":[{"id":"213","name_ua":"УЕЛЬС","name_en":"WALES","name_ru":"УЭЛЬС","short_name_ua":"УЕЛЬС","short_name_en":"WALES","short_name_ru":"УЭЛЬС","code":"000000213","last_change":"2017-08-30T21:04:00.000+03:00","status":"1"},{"id":"214","name_ua":"УЗБЕКИСТАН","name_en":"UZBEKISTAN","name_ru":"УЗБЕКИСТАН","short_name_ua":"УЗБЕКИСТАН","short_name_en":"UZBEKISTAN","short_name_ru":"УЗБЕКИСТАН","code":"000000214","last_change":"2017-05-11T21:10:00.000+03:00","status":"1"}
get_country_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_country_id(213));
get_area_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_area_list());
get_area_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_area_id(1));
get_area_filter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_area_filter(array(
// 'id' => 1,
'area_name' => 'В',
// 'country_id' => '215',
)));
get_district_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_district_list());
get_district_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_district_id(241));
get_district_filter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_district_filter(array(
// 'id' => '241',
// 'country_id' => '215',
'district_name' => 'Бере',
)));
get_locality_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_key');
print_r($intime->get_locality_list());
get_locality_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_locality_id(100));
get_locality_filter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_locality_filter(array(
// 'id' => 328,
// 'country_id' => 215,
// 'area_id' => 14,
'district_id' => 416,
// 'locality_name' => 'Сково',
)));
get_branch_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_branch_list());
get_branch_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_branch_id(328));
get_branch_filter($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_branch_filter(array(
// 'id' => 328,
// 'country_id' => 215,
// 'area_id' => 15,
// 'district_id' => 40,
// 'locality_id' => 39,
'branch_name' => 'Воло',
)));
get_goods_desc_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_goods_desc_list());
get_goods_desc_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_goods_desc_list());
get_box_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_box_list());
get_box_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_box_id(50));
declaration_create($data = array())
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r(
$intime->declaration_create(
[
...
]
)
);
get_branch_work_list()
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_branch_work_list());
get_branch_work_id($id)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->get_branch_work_id(200));
declStatus($number)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->declStatus('NUMBER_TTN'));
getTTN($number)
use InTime\InTime3;
include_once 'vendor/autoload.php';
$intime = new InTime3('API_KEY');
print_r($intime->getTTN('NUMBER_TTN'));