๐PHP
<?php
$token = getenv('AUTOCONTENT_TOKEN') ?: 'YOUR_API_TOKEN';
$endpoint = 'https://api.autocontentapi.com/content/Create';
$payload = [
'outputType' => 'datatable',
'resources' => [
[
'type' => 'text',
'content' => 'Company A raised $12M in Series A funding in Spain. Company B raised $35M in Series B funding in France.'
]
],
'text' => 'Create columns for company, country, funding stage, funding amount, and positioning notes.'
];
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token,
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($payload)
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("Request failed: {$status}\n{$body}");
}
echo $body . PHP_EOL;Last updated