Good afternoon, tell me please, there is a key of Yandex.services, judging by the documentation, the list of banks is given by the following request:
http://api.uslugi.yandex.ru/1.0/banks ? [key=<API-ключ>] & region=<регион>
Here is my code:
<?php ini_set('display_errors', 1); error_reporting(E_ALL); $xml = simplexml_load_file("http://api.uslugi.yandex.ru/1.0/banks?[key=***]®ion=Moscow"); ?>
Returns the following:
Warning: simplexml_load_file( http://api.uslugi.yandex.ru/1.0/banks?%5Bkey=***%5D®ion=Moscow): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in /var/www/neoflat/data/www/neoflatru/calc.php on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://api.uslugi.yandex.ru/1.0/banks?%5Bkey=***%5D®ion=Moscow" in /var/www/neoflat/data/www/neoflatru/calc.php on line 5
Error 401 judging by the documentation authorization error.
What am I doing wrong, who will tell?
Do not kick much, the first time I come across an API.