- Creating New Campaign
[[API:Function]] – goAddCampaign
-
This application is used to create new campaign. Newly created campaign belongs to user that authenticated a request.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
campaign_id – campaign id. Integer
-
campaign_name – name of campaign. String
-
campaign_type – type of campaign. String
-
did_pattern – did pattern. Integer
-
group_color – group color. String
-
call_route – call route. String
-
survey_type – type of survey, values is BROADCAST or PRESS1 only. String
-
number_channels – number of channel, values is 1,5,10,15,20, or 30 only. Integer
Returns:
result – “success” means that campaign has been created. String
result – “error” means that campaign has not been created, containing the error occurred. String
-
Error: Campaign Already Exist!
-
Error: Failed to add campaign.
-
Error: Set a value for Campaign ID or Campaign Type.
-
Error: Default value for campaign type is OUTBOUND, INBOUND, BLENDED and SURVEY only.
campaign_id – created campaign id. Integer
Sample Code:
<?php
$url = "https://jameshv.goautodial.com/goAPI/goCampaigns/goAPI.php"; # URL to GoAutoDial API file
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]
$postfields["responsetype"] = "json"; #json (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$postfields["did_pattern"] = ""; #Desired did pattern (required if campaign type is BLENDED)
$postfields["group_color"] = ""; #Desired group color (required if campaign type is BLENDED)
$postfields["call_route"] = ""; #Desired call route (required if campaign type is BLENDED)
$postfields["survey_type"] = ""; #survey type values is BROADCAST or PRESS1 only (required if campaign type is survey)
$postfields["number_channels"] = ""; #number channel values is 1,5,10,15,20, or 30 only (requred)
$postfields["campaign_type"] = ""; #Type of campaign, values is OITBOUND, INBOUND, BLENDED or SURVEY only. (required)
$postfields["campaign_id"] = ""; #Desired campaign id (required)
$postfields["campaign_name"] = ""; #Desired name of campaign
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
echo "Added New Camapign ID: ".$campaign_id;
} else {
# An error occured
echo $output->result;
}
?>
-
- Updating Campaign
[[API:Function]] – goEditCampaign
-
This application is used to update a campaign. Only campaign that belongs to authenticated user can be updated.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
campaign_id – campaign id. String
Returns:
result – “success” means that campaign has been updated successfully. String
result – “error” means that campaign has not been updated, containing the error occurred. String
-
Error: Set a value for Campaign ID.
-
Error: Default value for active is Y or N only.
-
Error: Default value for dial method are MANUAL,RATIO,ADAPT_HARD_LIMIT,ADAPT_TAPERED,ADAPT_AVERAGE,INBOUND_MAN only.
-
Error: Campaign doens't exist.
Sample Code:
<?php
$url = "https://jameshv.goautodial.com/goAPI/goCampaigns/goAPI.php"; # URL to GoAutoDial API file
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]
$postfields["responsetype"] = "json"; #json (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$postfields["campaign_id"] = ""; #Desired Camnpaign (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
echo "Update Success";
} else {
# An error occured
echo $output->result;
}
?>
-
- Deleting Campaign
[[API:Function]] – goDeleteCampaign
-
This application is used to delete a campaign. Only campaign that belongs to authenticated user can be delete.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
campaign_id – campaign id. Integer
-
Returns:
result – “success” means that campaign has been deleted successfully. String
result – “error” means that campaign has not been deleted, containing the error occurred. String
campaign_id – deleted campaign id. Integer
Sample Code:<?php
$url = "https://YOUR_URL/goAPI/goCampaigns/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$postfields["campaign_id"] = ""; #Desired campaign id. (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
echo "Delete Success";
} else {
# An error occured
echo $output->result;
}
?>
-
- Displaying Campaign
[[API:Function]] – getAllCampaigns
-
This application is used to get list of campaign belongs to user.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
Returns:
result – “success” means that query was successful. String
result – “error” means that query was not successful. , containing the error occurred. String
campaign_id – campaign id. Integer
campaign_name – name of campaign. String
active – status of campaign. String
dial_method – dial method of campaign. String
Sample Code:
<?php
$url = "https://YOUR_URL/goAPI/goCampaigns/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
if ($output->result=="success") {
# Result was OK!
for($i=0;$i<count($output->campaign_id);$i++){
echo $output->campaign_id[$i]."</br>";
echo $output->campaign_name[$i]."</br>";
echo $output->dial_method[$i]."</br>";
echo $output->active[$i]."</br>";
}
} else {
# An error occured
echo $output->result;
}
?>
-
- Displaying Campaign Information
[[API:Function]] – getCampaignInfo
-
Allows to retrieve some attributes of a given campaign. campaign should belong to the user that authenticated the request.
Mandatory parameters from “postfields” variables:
goUser- Username. String
goPass- Password. String
goAction- Action performed by the [[API:Functions]]. String
campaign_id – campaign id. Integer
Returns:
result – “success” means that query was successful. String
result – “error” means that query was not successful. , containing the error occurred. String
campaign_id – campaign id. Integer
campaign_name – name of campaign. String
active – status of campaign. String
dial_method – dial method of campaign. String
Sample Code:
<?php
$url = "https://YOUR_URL/goAPI/goCampaigns/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$postfields["campaign_id"] = ""; #variable for Campaign ID. (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
for($i=0;$i<count($output->campaign_id);$i++){
echo $output->campaign_id[$i]."</br>";
echo $output->campaign_name[$i]."</br>";
echo $output->dial_method[$i].'</br>';
echo $output->active[$i].'</br>';
}
} else {
# An error occured
echo $output->result;
}
?>
-
CAMPAIGN
- 1059 Корисниците го најдоа ова како корисно