Skip to content

Получение сервисного документа

Dmitry Kuznetsov edited this page Nov 16, 2013 · 5 revisions

Документация: получение сервисного документа

<?php
$api = new \Yandex\Fotki\Api('login');

try {
    $api->loadServiceDocument();
} catch (\Yandex\Fotki\Exception\ServerError $ex) {
    // серверная ошибка яндекса
} catch (\Yandex\Fotki\Exception\Api\ServiceDocument $ex) {
    // ошибка api
}

$serviceDocument = $api->getServiceDocument();
$serviceDocument->getUrlAlbumsCollection();
$serviceDocument->getUrlPhotosCollection();
$serviceDocument->getUrlTagsCollection();

$serviceDocument = unserialize(serialize($serviceDocument));