Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Created January 8, 2016 11:24
Show Gist options
  • Save remcotolsma/9d212a4ca5d209ef2579 to your computer and use it in GitHub Desktop.
Save remcotolsma/9d212a4ca5d209ef2579 to your computer and use it in GitHub Desktop.
Get available accommodations from Tommy Booking Support
<?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