-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathList.CreateCustomField.php
More file actions
51 lines (35 loc) · 1.16 KB
/
Copy pathList.CreateCustomField.php
File metadata and controls
51 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL);
require_once('CMBase.php');
//-----------------------------INPUT PARAMS---------------------------------------
$apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$list_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Text field example
$fieldName = 'Nickname';
$dataType = 'Text';
$options = '';
/*
// Below are examples for the other possible field types
// Number field example
$fieldName = 'Age';
$dataType = 'Number';
$options = '';
// Multi-option select one example
$fieldName = 'Sex';
$dataType = 'MultiSelectOne';
$options = 'Male||Female';
// Multi-option select many example
$fieldName = 'Hobby';
$dataType = 'MultiSelectMany';
$options = 'Surfing||Reading||Snowboarding';
*/
//-------------------------------------------------------------------------------
$cm = new CampaignMonitor( $apikey );
//Optional statement to include debugging information in the result
$cm->debug_level = 1;
//This is the actual call to the method
$result = $cm->listCreateCustomField( $list_id, $fieldName, $dataType, $options );
echo '<br><br>';
print_r($result);
?>