<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wavix.com/v3/10dlc/brands/{brand_id}/campaigns",
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([
'affiliate_marketing' => false,
'age_gated' => false,
'auto_renewal' => false,
'description' => 'Our campaign aims to …',
'direct_lending' => false,
'embedded_link_sample' => 'https://site.com/verify',
'embedded_links' => false,
'embedded_phones' => false,
'help' => true,
'help_keywords' => 'help',
'help_message' => 'For help, please visit www.site.com. To opt-out, reply STOP.',
'mock' => false,
'name' => 'My first campaign',
'optin' => true,
'optin_keywords' => 'begin,start',
'optin_message' => 'You are now opted-in for help please reply HELP, to stop please reply STOP',
'optin_workflow' => 'Our SMS ...',
'optout' => true,
'optout_keywords' => 'stop,quit,unsubscribe',
'optout_message' => 'You are now opted out and will receive no further messages',
'privacy_policy' => 'https://site.com/privacy-policy',
'sample1' => 'Your verification code is XXXXXX',
'sample2' => 'XXXX is your verification code',
'sample3' => 'Your code is XXXXXX, valid for 10 minutes',
'sample4' => 'Use code XXXXXX to confirm your login',
'sample5' => 'XXXXXX is your one-time passcode',
'terms_conditions' => 'https://site.com/terms-and-conditions',
'usecase' => '2FA'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}