<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://studio.edgeimpulse.com/v1/api/user/trial",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'fred@flintstones.org',
'name' => 'Fred Flintstone',
'organizationName' => 'My Company',
'expirationDate' => '2020-01-01T00:00:00Z',
'notes' => 'This is a trial for the company\'s new project.',
'useCase' => 'Industrial',
'userHasMLModelsInProduction' => 'no',
'companyName' => 'ACME Inc.',
'companySize' => '1-10',
'country' => 'United States',
'stateOrProvince' => 'California',
'redirectUrlOrigin' => 'https://studio.edgeimpulse.com',
'redirectUrlQueryParams' => 'utm_source=google&utm_medium=cpc&utm_campaign=trial'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}