<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.crevio.co/v1/socials/automations",
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([
'account_id' => '<string>',
'name' => '<string>',
'keywords' => [
'<string>'
],
'exclude_keywords' => [
'<string>'
],
'dm_message' => '<string>',
'buttons' => [
[
'title' => '<string>',
'url' => '<string>'
]
],
'comment_reply' => '<string>',
'also_match_in_dms' => true,
'dm_delay_seconds' => 123,
'audience' => [
],
'follow_gate' => [
'message' => '<string>',
'button_label' => '<string>',
'not_following_message' => '<string>'
],
'repeat_policy' => [
'cooldown_hours' => 123
],
'platform_post_id' => '<string>',
'post_id' => '<string>',
'post_title' => '<string>',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}