<?php require_once dirname(__FILE__) . '/../sources/Api.php'; try { $rotatorData = '<createRotatorRequestData><name>ApiTest' . date("Y-m-d") . '</name><type>all</type></createRotatorRequestData>'; $cityAdsApi = new CityAds_Api(); $response = $cityAdsApi->setAccessToken('6420072d37bf14f1df182d0fe0efa2d9')->setFormat('xml')->post('rotator', $rotatorData); header("Content-type: text/xml; charset=utf-8"); print_r($response); } catch (Exception $ex) { print_r("Code: " . $ex->getCode() . "; Message: " . $ex->getMessage()); }
<?php require_once dirname(__FILE__) . '/../sources/Api.php'; try { $cityAdsApi = new CityAds_Api(); $response = $cityAdsApi->setAccessToken('6420072d37bf14f1df182d0fe0efa2d9')->setFormat('xml')->get('profile'); header("Content-type: text/xml; charset=utf-8"); print_r($response); } catch (Exception $ex) { print_r("Code: " . $ex->getCode() . "; Message: " . $ex->getMessage()); }
<?php require_once dirname(__FILE__) . '/../sources/Api.php'; try { $cityAdsApi = new CityAds_Api(); $response = $cityAdsApi->setAccessToken('6420072d37bf14f1df182d0fe0efa2d9')->get('offers', array('type' => 'web', 'start' => 0, 'limit' => 30, 'linksonly' => 'true')); header("Content-type: application/json; charset=utf-8"); print_r($response); } catch (Exception $ex) { print_r("Code: " . $ex->getCode() . "; Message: " . $ex->getMessage()); }
<?php require_once dirname(__FILE__) . '/../sources/Api.php'; try { $newProfileData = '<setProfileRequestData><first_name>John</first_name><last_name>Smith</last_name><phone>9991112233</phone></setProfileRequestData>'; $cityAdsApi = new CityAds_Api(); $response = $cityAdsApi->setAccessToken('6420072d37bf14f1df182d0fe0efa2d9')->setFormat('xml')->put('profile', $newProfileData); header("Content-type: text/xml; charset=utf-8"); print_r($response); } catch (Exception $ex) { print_r("Code: " . $ex->getCode() . "; Message: " . $ex->getMessage()); }