Created
January 8, 2016 11:24
-
-
Save remcotolsma/9d212a4ca5d209ef2579 to your computer and use it in GitHub Desktop.
Get available accommodations from Tommy Booking Support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define( 'WP_USE_THEMES', false ); | |
require '../wp-blog-header.php'; | |
$api_key = ''; | |
$url = 'https://www.tommybookingsupport.com/api/boeking/get-event-data'; | |
$data = array( | |
'apikey' => $api_key, | |
'aankomstDatum' => '2016-06-01', | |
'aantalEenheden' => 14, | |
'aantalPersonen' => 4, | |
// 'accommodatie' => 422, | |
// 'groep' => 101, | |
); | |
$response = wp_remote_post( $url, array( | |
'body' => $data, | |
) ); | |
if ( 200 === wp_remote_retrieve_response_code( $response ) ) { | |
$result = wp_remote_retrieve_body( $response ); | |
$data = json_decode( $result ); | |
var_dump( $data ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment