fbpx
Search
Close this search box.
Search
Close this search box.

< / >

APIs Campaign

4. Campaign creation

URL:

https://wv{{wolkvox_server}}.wolkvox.com/api/v2/campaign.php?api=create_campaign&type_campaign={{type_campaign}}

Description:

With this API it is possible to create preview or predictive campaigns in wolkvox manager from external platforms.

Benefit:

Use this API to be more efficient in the process of creating preview or predictive campaigns, in case you have an external platform where they provide the necessary information.

How it works:

  • The consumption of this API is done by POST method.
  • In the json the parameters are added according to the operation or process to be performed.
  • To consume this API you must replace in the url {{{wolkvox_server}} by the nomenclature of the server of the operation.
  • The wolkvox-token header must be used to make use of the authorization token.
  • Note that the same token cannot be consumed simultaneously, so you can schedule the next API to be consumed when the result of the previous one is successful.

REQUEST

NAME DESCRIPTION TYPE
type_campaign (URL) Campaign type. This field can take the values “preview” or “predictive”. String
campaign_name Campaign name String
campaign_description Description of the campaign String
start_time Campaign start time in the format {{YYYYmmddhhiiss}}. This field only applies to “predictive” type campaigns as “preview” campaigns do not have a runtime. String
end_time End time of the campaign in the format {{YYYYmmddhhiiss}}. This field only applies to “predictive” type campaigns since “preview” type campaigns do not have runtime. String
skill_id Refers to the numerical identification of the skill String
opt# Additional field where you enter additional campaign information String
enable_edition Allows enabling campaign editing, this field accepts the values “yes” and “no”. String

RESPONSE

NAME DESCRIPTION TYPE
id_campaing Corresponds to the campaign identification number String
name_campaing Campaign name String

Possible response codes
				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://wv{{wolkvox_server}}.wolkvox.com/api/v2/campaign.php?api=create_campaign&type_campaign={{type_campaign}}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "campaign_name": "",
    "campaign_description": "",
    "start_time": "",
    "end_time": "",
    "skill_id": "",
    "opt1": "",
    "opt2": "",
    "opt3": "",
    "opt4": "",
    "opt5": "",
    "opt6": "",
    "opt7": "",
    "opt8": "",
    "opt9": "",
    "opt10": "",
    "opt11": "",
    "opt12": "",
    "enable_edition": ""
}',
  CURLOPT_HTTPHEADER => array(
    'wolkvox-token: {{token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
				
			

RESPONSE

				
					{
    "code": 201,
    "error": null,
    "msg": "The # campaign_id has been created successfully",
    "data": [
        {
            "id_campaign": "",
            "name_campaign": ""
        }
    ]
}
				
			
We use cookies, if you continue browsing we will assume that you agree. You can read more about the use of cookies in our privacy policies and treatment of personal data