Notice: Uninitialized string offset: 0 in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php on line 1
Notice: Uninitialized string offset: 0 in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php on line 1
Warning: session_start(): Cannot start session when headers already sent in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-content/plugins/element-ready-lite/inc/Base/SignIn.php on line 23
Warning: session_start(): Cannot start session when headers already sent in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-content/plugins/element-ready-lite/inc/Base/SignUp.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
Warning: Cannot modify header information - headers already sent by (output started at /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:1) in /data01/virt100180/domeenid/www.visitvirumaa.com/htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":2409,"date":"2023-04-08T19:25:59","date_gmt":"2023-04-08T19:25:59","guid":{"rendered":"https:\/\/visitvirumaa.com\/?page_id=2409"},"modified":"2023-04-08T19:25:59","modified_gmt":"2023-04-08T19:25:59","slug":"test-2","status":"publish","type":"page","link":"https:\/\/visitvirumaa.com\/test-2\/","title":{"rendered":"test"},"content":{"rendered":"\n<?php<\/p>\n\n\n\n
\/\/ Define the API endpoint URLs<\/p>\n\n\n\n
$entries_url = ‘https:\/\/www.visitestonia.com\/api\/Entries_v4.xsd’;<\/p>\n\n\n\n
$domains_url = ‘https:\/\/www.visitestonia.com\/api\/Domains_v2.xsd’;<\/p>\n\n\n\n
\/\/ Define the version parameter<\/p>\n\n\n\n
$version = ‘1.0’;<\/p>\n\n\n\n
\/\/ Define the authentication credentials<\/p>\n\n\n\n
$username = ‘VisitVirumaaVe’;<\/p>\n\n\n\n
$password = ‘yXQSNykX6v’;<\/p>\n\n\n\n
\/\/ Define the delay between API requests in seconds<\/p>\n\n\n\n
$delay = 5;<\/p>\n\n\n\n
\/\/ Define the function to make API requests<\/p>\n\n\n\n
function get_api_response($url, $version, $username, $password) {<\/p>\n\n\n\n
\/\/ Set up the cURL request<\/p>\n\n\n\n
$ch = curl_init();<\/p>\n\n\n\n
curl_setopt($ch, CURLOPT_URL, $url . ‘?version=’ . $version);<\/p>\n\n\n\n
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application\/xml’));<\/p>\n\n\n\n
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<\/p>\n\n\n\n
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);<\/p>\n\n\n\n
curl_setopt($ch, CURLOPT_USERPWD, $username . ‘:’ . $password));<\/p>\n\n\n\n
\/\/ Make the request<\/p>\n\n\n\n
$response = curl_exec($ch);<\/p>\n\n\n\n
\/\/ Check for errors<\/p>\n\n\n\n
$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);<\/p>\n\n\n\n
if ($http_status_code >= 400) {<\/p>\n\n\n\n
throw new Exception(‘Error ‘ . $http_status_code . ‘: ‘ . curl_error($ch));<\/p>\n\n\n\n
}<\/p>\n\n\n\n
\/\/ Close the cURL session<\/p>\n\n\n\n
curl_close($ch);<\/p>\n\n\n\n
\/\/ Return the API response<\/p>\n\n\n\n
return $response;<\/p>\n\n\n\n
}<\/p>\n\n\n\n
\/\/ Make the initial request to the terms of use page to get user consent<\/p>\n\n\n\n
$terms_of_use_url = ‘https:\/\/www.puhkaeestis.ee\/api\/use_terms’;<\/p>\n\n\n\n
$terms_of_use_response = file_get_contents($terms_of_use_url);<\/p>\n\n\n\n
if (strpos($terms_of_use_response, ‘I agree to the terms of use’) === false) {<\/p>\n\n\n\n
die(‘Error: Could not get user consent for API usage.’);<\/p>\n\n\n\n
}<\/p>\n\n\n\n
\/\/ Make the first API request for the entries service<\/p>\n\n\n\n
$entries_response = get_api_response($entries_url, $version, $username, $password);<\/p>\n\n\n\n
\/\/ Wait for the specified delay before making the next request<\/p>\n\n\n\n
sleep($delay);<\/p>\n\n\n\n
\/\/ Make the second API request for the domains service<\/p>\n\n\n\n
$domains_response = get_api_response($domains_url, $version, $username, $password);<\/p>\n\n\n\n
\/\/ Process the API responses as needed<\/p>\n\n\n\n
\/\/ …<\/p>\n\n\n\n
?>
<\/p>\n","protected":false},"excerpt":{"rendered":"
<?php \/\/ Define the API endpoint URLs $entries_url = ‘https:\/\/www.visitestonia.com\/api\/Entries_v4.xsd’; $domains_url = ‘https:\/\/www.visitestonia.com\/api\/Domains_v2.xsd’; \/\/ Define the version parameter $version = ‘1.0’; \/\/ Define the authentication credentials $username = ‘VisitVirumaaVe’; $password = ‘yXQSNykX6v’; \/\/ Define the delay between API requests in seconds $delay = 5; \/\/ Define the function to make API requests function get_api_response($url, $version, …<\/p>\n
test<\/span> Read More »<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-2409","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/pages\/2409"}],"collection":[{"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/comments?post=2409"}],"version-history":[{"count":1,"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/pages\/2409\/revisions"}],"predecessor-version":[{"id":2410,"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/pages\/2409\/revisions\/2410"}],"wp:attachment":[{"href":"https:\/\/visitvirumaa.com\/wp-json\/wp\/v2\/media?parent=2409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}