<?php
$apiKey = 'your-api-key';
$apiUrl = 'https://api.itlive.nl/website/create';
$data = [
'name' => 'Mijn Website',
'domain' => 'mijnwebsite.nl',
'template' => 'business'
];
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
]);
$response = curl_exec($ch);
$result = json_decode($response, true);
if ($result['success']) {
echo "Website aangemaakt: " . $result['website_id'];
} else {
echo "Error: " . $result['message'];
}
?>