<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://studio-api.onlytraffic.com/api/external/v1/agencies/{uuid}",
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([
'name' => 'Bright Studio',
'slug' => 'bright-studio',
'code' => 'BST',
'description' => '<string>',
'website' => '<string>',
'tg_contact' => '<string>',
'email' => 'jsmith@example.com',
'email_published' => true,
'countries' => 'worldwide',
'model_commission' => 50,
'model_commission_max' => 50,
'model_commission_custom' => '<string>',
'model_requirements' => '<string>',
'platforms' => [
],
'offered_services' => [
],
'founded' => '2023-12-25',
'topagencies_publish' => true
]),
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;
}