A newest library to communicate with Allegro Api. The library is OOP, good tested and easy to use. Make your job enjoyable. The version is tested with PHP5.5
In this section I describe a class and methods you should use
To run test you must insert you login, password and appkey to Config/config.ini file.
login = "Insert your login here"
hashPassword = "Insert your password's hash here - NEVER do it in production"
apikey = "Insert your apikey here"
sandbox = false
countryCode = 1
The file is use only by tests.
You can create your access data by http://allegro.pl/myaccount/webapi.php/ page. sandbox is use to switch allegro sandbox and production version. countryCode is used to select current country. Default 1 mean Poland. If you want you can change country to communication with other allegroGroup services like: aukro.cz, molotok.ru, aukro.ua, teszvesz.hu
Never storage your plain password. Your app should always hash it by sha256 (used by allegro)
$hashPassword = base64_encode(hash('sha256', YOUR_ALLEGRO_PASSWORD, true));
AllegroApi is main class. Provide api access interface.
Require one object with login, hashPassword (or password - strongly no recomended), apikey, sandbox, countryCode fields. The data is use to init connections.
Login to allegro (use constructor data)
The api use _call to maping functions names to allegro request. You should use short names without "do". Use getCountries (to rum allegro doGetCountries function).
$allegroApi = new AllegroApi($login, $hashPassword, $apiKey, $sandbox, $countryCode);
$countrisResponse = $allegroApi->getCountries();
#Allegro functions documentation Description of all allegro functions are available on http://allegro.pl/webapi/documentation.php
Clone empty project:
git clone https://github.com/SebastianPozoga/PHP-AllegroApi-EmptyProject.git
composer install
And run:
php index.php
Run tests by:
phpunit tests/AllegroApiTest
It is strong recomended to use new version of PHP Allegro Api Library. If you must use old version is available on https://github.com/SebastianPozoga/Allegro-PHP-API-14